Linux File & Directory Management – Full Quiz
← Back to File & Directory Management
← Back to Linux Commands
← Back to Quiz Home
This quiz contains 20 questions focused on Linux file and directory management.
It helps DevOps engineers practice common filesystem operations used on servers.
Which command is used to create a directory?
The mkdir (make directory) command is used to create new directories.
Which option with mkdir creates parent directories if they do not exist?
The -p (parents) option allows mkdir to create the full path of directories, including any missing parent directories.
Which command creates an empty file?
The touch command updates the timestamp of a file or creates an empty file if it doesn't exist.
Which command removes an empty directory?
The rmdir command is specifically designed to remove empty directories.
Which command removes a directory and its contents recursively?
rm -rf (remove recursive force) deletes a directory and all files/subdirectories inside it without prompting.
Which command copies files or directories?
The cp (copy) command is used to duplicate files or directories.
Which option with cp copies directories recursively?
The -r (recursive) option is required when copying directories to include all their contents.
Which command moves or renames files?
The mv (move) command is used both for moving files to a new location and for renaming them.
Which command displays the contents of a file?
The cat command prints the contents of a file to standard output.
Which command shows a directory structure in a tree format?
The tree command displays a recursive directory listing in a visual tree-like format.
Which editor is commonly used to edit files in Linux terminals?
vi (or vim) is a standard, powerful text editor available on almost all Linux systems.
Which command opens a file in read/write mode using vi?
Running vi filename opens the file in the vi editor for editing.
Which command lists files and directories in the current directory?
ls list the files and directories in the current working directory.
Which command deletes a file?
The rm (remove) command is used to delete files.
Which command removes multiple files at once?
You can pass multiple filenames to rm to delete them all in one go.
Which command shows detailed information about files?
ls -l provides a long listing format containing permissions, ownership, size, and modification time.
Which command creates multiple directories at once?
mkdir -p allows creating a nested hierarchy of directories in a single command.
Which command is safer for copying large directory structures in production?
rsync is preferred for large transfers because it supports resuming, delta updates, and preserves permissions/ownership reliably.
Which command prints the content of a file to the terminal?
cat writes the file content directly to the terminal output.
Which command helps visualize directory contents recursively?
tree is the best tool for visualizing the recursive structure of directories.
Quiz Progress
0 / 0 questions answered
(0% )
0 correct
Quiz Complete!
0%
Reset quiz
📩 Get weekly DevOps quizzes & guides
📬 Weekly DevOps, Cloud & Gen AI quizzes & guides