Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Question 1 of 60 · Linux File System Hierarchy · Easy
In Linux, the entire file system starts from a single top-level directory. What is this directory called?
Not quite. Try another option.
Answer: Root directory /
The Linux file system is a single inverted tree that begins at the root directory, represented by a forward slash /. All other directories branch out from it.
Question 2 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Easy
Which directory typically stores the personal files and subdirectories of regular users?
Not quite. Try another option.
Answer: /home
The /home directory contains a subdirectory for each regular user (e.g., /home/alice) where their personal files and settings are stored.
Question 3 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Easy
Which directory is used to store system-wide configuration files?
Not quite. Try another option.
Answer: /etc
The /etc directory holds system configuration files and shell scripts used to boot and configure the system and its services.
Question 4 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Easy
The /tmp directory is primarily used to store which type of files?
Not quite. Try another option.
Answer: Temporary files
The /tmp directory holds temporary files created by programs and users. These files are often cleared when the system reboots.
Question 5 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Easy
Which directory commonly contains variable data such as log files, spool files, and mail?
Not quite. Try another option.
Answer: /var
The /var directory stores variable data whose contents change frequently, including logs, mail queues, and print spools.
Question 6 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Easy
Which directory mainly holds essential user command binaries like ls, cp, and cat?
Not quite. Try another option.
Answer: /bin
The /bin directory contains essential command binaries (executables) needed by all users, such as ls, cp, mv, and cat.
Question 7 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Easy
The /sbin directory typically stores binaries intended mainly for which type of user?
Not quite. Try another option.
Answer: System administrator (root)
The /sbin directory contains system administration binaries such as fdisk and reboot, generally intended for the root user.
Question 8 of 60 · Absolute and Relative Paths · Easy
Which of the following is an example of an absolute path?
Not quite. Try another option.
Answer: /home/user/docs
An absolute path starts from the root directory / and specifies the complete location, so /home/user/docs is absolute. Paths beginning with . or .. are relative.
Question 9 of 60 · Absolute and Relative Paths · Easy
In a relative path, what does the symbol .. represent?
Not quite. Try another option.
Answer: The parent directory
The .. symbol refers to the parent directory (one level up), while a single . refers to the current directory.
Question 10 of 60 · pwd · Easy
What does the pwd command display?
Not quite. Try another option.
Answer: The full path of the current working directory
The pwd (print working directory) command prints the absolute path of the directory you are currently in.
Question 11 of 60 · cd · Easy
Which command is used to change the current working directory?
Not quite. Try another option.
Answer: cd
The cd (change directory) command moves you into a specified directory, for example cd /home/user.
Question 12 of 60 · ls · Easy
Which command lists the contents of a directory?
Not quite. Try another option.
Answer: ls
The ls command lists files and directories within the current or specified directory.
Question 13 of 60 · mkdir · Easy
Which command is used to create a new directory?
Not quite. Try another option.
Answer: mkdir
The mkdir (make directory) command creates one or more new directories, for example mkdir projects.
Question 14 of 60 · rmdir · Easy
The rmdir command is used to remove a directory only when the directory is:
Not quite. Try another option.
Answer: Empty
The rmdir command removes only empty directories. To delete a directory with contents, use rm -r instead.
Question 15 of 60 · touch · Easy
What is the most common use of the touch command?
Not quite. Try another option.
Answer: Creating a new empty file
The touch command creates a new empty file if it does not exist, or updates the timestamp of an existing file.
Question 16 of 60 · cat · Easy
Which command is commonly used to display the contents of a text file on the screen?
Not quite. Try another option.
Answer: cat
The cat (concatenate) command reads a file and displays its contents on the terminal, for example cat notes.txt.
Question 17 of 60 · cp · Easy
Which command is used to copy files from one location to another?
Not quite. Try another option.
Answer: cp
The cp (copy) command duplicates files or directories, for example cp file1.txt file2.txt.
Question 18 of 60 · mv · Easy
Besides moving files, the mv command is also commonly used to:
Not quite. Try another option.
Answer: Rename files
The mv (move) command moves files between locations and can also rename a file, for example mv old.txt new.txt.
Question 19 of 60 · rm · Easy
Which command is used to delete (remove) files in Linux?
Not quite. Try another option.
Answer: rm
The rm (remove) command deletes files. Use it carefully, as deleted files are usually not recoverable.
Question 20 of 60 · clear · Easy
What does the clear command do in the terminal?
Not quite. Try another option.
Answer: Clears the terminal screen
The clear command clears the visible content of the terminal screen, giving you a clean prompt without deleting anything.
Question 21 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Medium
A system administrator needs to store a third-party application that is not part of the default distribution. Which directory is conventionally intended for such optional add-on software packages?
Not quite. Try another option.
Answer: /opt
The /opt directory is reserved for optional or add-on application software packages that are not part of the default system installation.
Question 22 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Medium
Log files, mail spools, and print queues that constantly change in size are typically found under which directory?
Not quite. Try another option.
Answer: /var
The /var directory holds variable data such as logs, mail spools, and print queues whose contents change frequently during system operation.
Question 23 of 60 · Absolute and Relative Paths · Medium
You are currently in /home/user/projects. Which command uses a relative path to move to /home/user/documents?
Not quite. Try another option.
Answer: cd ../documents
.. refers to the parent directory /home/user, so ../documents correctly resolves to /home/user/documents using a relative path.
Question 24 of 60 · Absolute and Relative Paths · Medium
Which of the following is an example of an absolute path?
Not quite. Try another option.
Answer: /usr/local/bin
An absolute path always begins from the root directory /. The others start from the current directory, making them relative paths.
Question 25 of 60 · rmdir · Medium
A user runs rmdir myfolder but receives the error Directory not empty. What is the most appropriate reason?
Not quite. Try another option.
Answer: rmdir only removes empty directories
The rmdir command deletes only empty directories. To remove a directory with contents, use rm -r instead.
Question 26 of 60 · cp · Medium
Which command correctly copies an entire directory data along with all its subdirectories into /backup?
Not quite. Try another option.
Answer: cp -r data /backup
The -r (recursive) option is required to copy a directory and all of its contents. Without it, cp refuses to copy directories.
Question 27 of 60 · mv · Medium
In a single directory, a user runs mv report.txt summary.txt where summary.txt does not yet exist. What is the result?
Not quite. Try another option.
Answer: report.txt is renamed to summary.txt
When the destination is not an existing directory, mv renames the source file. So report.txt becomes summary.txt.
Question 28 of 60 · ls · Medium
Which ls command lists all files including hidden ones in a long, detailed format?
Not quite. Try another option.
Answer: ls -la
The -l option gives the long listing format and -a includes hidden files (those starting with .). Combined as -la, both apply.
Question 29 of 60 · File Searching using find · Medium
Which command finds all files ending in .log within /var and its subdirectories?
Not quite. Try another option.
Answer: find /var -name "*.log"
The syntax find <path> -name <pattern> searches recursively. Here find /var -name "*.log" matches all files ending in .log under /var.
Question 30 of 60 · Disk Management Commands (du, df) · Medium
You want a human-readable report of free and used space on all mounted filesystems. Which command is best?
Not quite. Try another option.
Answer: df -h
df reports disk space usage of filesystems, and the -h flag displays sizes in human-readable units (KB, MB, GB).
Question 31 of 60 · Disk Management Commands (du, df) · Medium
Which command estimates the total disk space consumed by a specific directory called photos?
Not quite. Try another option.
Answer: du -sh photos
du estimates directory space usage. The -s gives a summarized total and -h makes it human-readable, so du -sh photos fits.
Question 32 of 60 · touch · Medium
A user runs touch notes.txt on a file that already exists. What happens?
Not quite. Try another option.
Answer: Its access and modification timestamps are updated
If the file exists, touch updates its access and modification times without changing the contents. Only for a nonexistent file does it create an empty one.
Question 33 of 60 · cat · Medium
Which command displays the contents of file1.txt and file2.txt combined into one output stream?
Not quite. Try another option.
Answer: cat file1.txt file2.txt
Passing multiple filenames to cat concatenates and displays their contents in sequence on standard output.
Question 34 of 60 · history command · Medium
Which command re-executes the command that was numbered 45 in your shell history?
Not quite. Try another option.
Answer: !45
In bash, !n re-runs the command at position n in the history list, so !45 re-executes command number 45.
Question 35 of 60 · su · Medium
A regular user wants to switch to the root account with root's full environment loaded. Which command is correct?
Not quite. Try another option.
Answer: su -
su - (or su -l) starts a login shell for root, loading root's environment. Plain su switches user but keeps the current environment.
Question 36 of 60 · Directory Visualization using tree · Medium
Which tree command displays the directory structure limited to only 2 levels of depth?
Not quite. Try another option.
Answer: tree -L 2
The -L option in tree sets the maximum display depth. tree -L 2 shows only two levels of the directory hierarchy.
Question 37 of 60 · mkdir · Medium
Which command creates the nested directory path project/src/main in one step, even if the parent directories do not exist?
Not quite. Try another option.
Answer: mkdir -p project/src/main
The -p (parents) option tells mkdir to create any missing intermediate directories, allowing the full nested path to be built at once.
Question 38 of 60 · rm · Medium
Which command forcibly deletes a directory oldapp and everything inside it without prompting?
Not quite. Try another option.
Answer: rm -rf oldapp
-r makes deletion recursive (for directories) and -f forces removal without prompting. Together rm -rf deletes the directory and all contents.
Question 39 of 60 · Root Directory Structure · Medium
In the Linux filesystem hierarchy, what does the single character / at the very top represent?
Not quite. Try another option.
Answer: The root directory of the entire filesystem
The / symbol denotes the root directory, the top-most node from which all other files and directories branch. Root's home is /root, which is different.
Question 40 of 60 · read · Medium
In a shell script, what does the command read name do when executed?
Not quite. Try another option.
Answer: Waits for user input and stores it in the variable name
The read command reads a line from standard input and assigns it to the specified variable, here storing the user's input in name.
Question 41 of 60 · Important Linux Directories (/bin, /sbin, /home, /etc, /usr, /var, /tmp, /opt, /lib) · Hard
A system administrator notices that /var is filling up rapidly on a busy web server. Which combination of contents is most likely responsible for this growth?
Not quite. Try another option.
Answer: Log files, mail spools, and print queues that accumulate over time
/var holds variable data such as /var/log, /var/mail, and /var/spool. On a busy server, growing log files and spool queues are the usual cause of rapid space consumption.
Question 42 of 60 · Absolute and Relative Paths · Hard
The current working directory is /home/user/projects. After running cd ../../etc, then cd ./network, what is the resulting absolute path (assuming it exists)?
Not quite. Try another option.
Answer: /etc/network
../.. moves from /home/user/projects up two levels to /home... actually up two levels: projects→user→home, then /etc is a sibling. cd ../../etc resolves to /etc, and ./network resolves to /etc/network.
Question 43 of 60 · rm · Hard
A user runs rm -rf /tmp/data / (with an accidental space before the final /). Assuming no protection flags are active, what is the intended target versus the actual danger?
Not quite. Try another option.
Answer: It recursively deletes /tmp/data and then attempts to recursively delete the entire root filesystem /
rm treats each argument as a separate target. The space makes /tmp/data and / two operands, so it deletes /tmp/data and then attempts to wipe the entire root filesystem — a classic catastrophic typo.
Question 44 of 60 · Disk Management Commands (du, df) · Hard
You run df -h and see / at 100% full, but du -sh / reports far less than the disk capacity. What is the most likely explanation?
Not quite. Try another option.
Answer: A deleted file is still held open by a running process, keeping its blocks allocated
When a file is deleted but still open by a process, its directory entry is gone (so du can't count it) but its blocks remain allocated (so df still sees them). Restarting the process or truncating the descriptor frees the space.
Question 45 of 60 · File Searching using find · Hard
Which find command correctly locates all regular files under /var/log modified in the last 24 hours and larger than 10 MB, then deletes them?
Not quite. Try another option.
Answer: find /var/log -type f -mtime -1 -size +10M -delete
-mtime -1 means modified within the last day, -size +10M means larger than 10 MB, and -type f restricts to regular files. -mtime +1 means older than a day, -size -10M means smaller, and -type d matches directories.
Question 46 of 60 · cp · Hard
You want to copy directory src to dest while preserving all attributes (permissions, timestamps, ownership, symlinks) and recursing into subdirectories. Which single option achieves this most completely?
Not quite. Try another option.
Answer: cp -a src dest
cp -a (archive mode) equals -dR --preserve=all: it recurses, preserves symlinks, and keeps mode, ownership, and timestamps. -r recurses but does not preserve attributes; -p preserves attributes but does not recurse; -f only forces overwrite.
Question 47 of 60 · mv · Hard
In directory /data containing files a.txt and b.txt, you run mv a.txt b.txt. What happens?
Not quite. Try another option.
Answer: a.txt is renamed to b.txt, silently overwriting the existing b.txt
By default mv overwrites the destination without prompting (unless -i is used). The original b.txt is replaced by a.txt, and a.txt no longer exists.
Question 48 of 60 · rmdir · Hard
You attempt rmdir /project/build but get Directory not empty. The directory contains only empty subdirectories a/, b/, and c/. Which command removes the whole tree using rmdir semantics?
Not quite. Try another option.
Answer: rmdir -p /project/build/a repeated, or rmdir /project/build/* before rmdir /project/build
rmdir only removes empty directories and has no recursive flag. You must remove the empty children first (e.g., rmdir /project/build/*) then the parent. -r, -f, and --recursive are not valid rmdir options.
Question 49 of 60 · ls · Hard
Which ls command lists all entries (including hidden), sorts by modification time with newest last, and shows sizes in human-readable form in long format?
Not quite. Try another option.
Answer: ls -altrh
-a shows hidden files, -l is long format, -t sorts by mtime (newest first), -r reverses so newest appears last, and -h gives human-readable sizes. Omitting -r leaves newest first; omitting -t removes time sorting.
Question 50 of 60 · su · Hard
What is the key behavioral difference between su user and su - user?
Not quite. Try another option.
Answer: su - user starts a full login shell loading the target user's environment and working directory, while su user keeps the current environment
The - (or -l) makes su simulate a full login: it resets environment variables, sources login profiles, and switches to the target's home directory. Without it, most of the previous environment is retained.
Question 51 of 60 · history command · Hard
A user wants to re-execute the command that was run 3 commands ago in the current session. Which shell shortcut does this correctly in bash?
Not quite. Try another option.
Answer: !-3
!-3 refers to the command 3 positions back from the current one. !3 runs the command numbered 3 in the history list (absolute, not relative). history -3 and ^3 are not valid re-execution syntaxes.
Question 52 of 60 · Directory Visualization using tree · Hard
Which tree command displays only directories (no files), limited to 2 levels of depth, including hidden directories?
Not quite. Try another option.
Answer: tree -d -L 2 -a
-d shows directories only, -L 2 limits depth to 2 levels, and -a includes hidden entries. -f prints full paths (still shows files), -L 1 limits to one level, and --noreport only suppresses the summary line.
Question 53 of 60 · read · Hard
In a bash script, the line read -p "Name: " -t 5 name behaves how?
Not quite. Try another option.
Answer: Prints the prompt Name: , waits up to 5 seconds for input, and stores it in name
-p supplies an inline prompt and -t 5 sets a 5-second timeout after which read returns non-zero. Reading a fixed number of characters uses -n; reading from a descriptor uses -u.
Question 54 of 60 · cat · Hard
Which command uses cat with a here-document to write two lines into file.txt, overwriting any existing content?
Not quite. Try another option.
Answer: cat > file.txt << EOF\nline1\nline2\nEOF
> redirects stdout to the file, truncating it first, while the << EOF here-document feeds the lines as input to cat. >> would append rather than overwrite, and the other forms redirect the file into cat instead of writing to it.
Question 55 of 60 · Root Directory Structure · Hard
According to the Filesystem Hierarchy Standard (FHS), which directory is intended to be mountable read-only and shareable across multiple hosts because it contains no host-specific or variable data?
Not quite. Try another option.
Answer: /usr
The FHS designates /usr as shareable and read-only: it holds architecture-dependent read-only programs and data. /etc is host-specific config, /var is variable data, and /root is the root user's home.
Question 56 of 60 · touch · Hard
You run touch -t 202401011200.30 report.log on an existing file. What is the effect?
Not quite. Try another option.
Answer: Sets the file's access and modification times to Jan 1, 2024 at 12:00:30
-t accepts a timestamp in [[CC]YY]MMDDhhmm[.ss] format. Here it sets both atime and mtime to 2024-01-01 12:00:30. touch never changes size or content.
Question 57 of 60 · mkdir · Hard
Which command creates the nested path /app/config/db in one step even if /app and /app/config do not yet exist, and sets permissions to 755?
Not quite. Try another option.
Answer: mkdir -p -m 755 /app/config/db
-p creates parent directories as needed, and -m 755 sets the mode of the final directory. Without -p, mkdir fails if parents are missing. -r and --nested are not valid mkdir options.
Question 58 of 60 · pwd · Hard
A directory /data/real has a symlink /data/link pointing to it. You cd /data/link then run pwd and pwd -P. What do they output respectively?
Not quite. Try another option.
Answer: /data/link and /data/real
Plain pwd (logical, -L) shows the path as you traversed it, including the symlink: /data/link. pwd -P resolves symlinks to the physical path: /data/real.
Question 59 of 60 · Disk Management Commands (du, df) · Hard
Which command reports the total apparent size (not disk-allocated blocks) of a directory /backup in a single summarized human-readable line?
Not quite. Try another option.
Answer: du -sh --apparent-size /backup
-s summarizes into one total, -h is human-readable, and --apparent-size counts file byte sizes rather than allocated blocks. -a lists every file, -c adds a grand total but still lists entries, and df reports filesystem usage, not directory content.
Question 60 of 60 · Linux File System Hierarchy · Hard
During early boot before /usr is mounted, the system must run essential recovery and administrative binaries. Which pair of directories was historically kept on the root filesystem specifically to guarantee these binaries are available at that stage?
Not quite. Try another option.
Answer: /bin and /sbin
/bin (essential user commands) and /sbin (essential system/admin commands) traditionally lived on the root filesystem so they were available before /usr mounted. The /usr/* variants may reside on separately mounted filesystems.
That's unit 3
Answer a few questions and your score shows up here.
Nearly through. Did unit 3 of CSE105 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 3 of CSE105 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.