Which command is used to view the contents of a file one screen at a time?
less is the standard, more powerful pager.
Why this answer
The 'less' command is a terminal pager that allows forward and backward navigation through text files.
45 questions · Finding Your Way ON A Linux System · All types, answers revealed
Which command is used to view the contents of a file one screen at a time?
less is the standard, more powerful pager.
Why this answer
The 'less' command is a terminal pager that allows forward and backward navigation through text files.
To navigate from your current directory to your home directory regardless of your current location, which command is most efficient?
The tilde represents the home directory path.
Why this answer
The cd command without arguments or with the tilde character defaults to the user's home directory.
You are searching for a command that deals with 'groups' and want to see all manual pages that mention this term. Which command is most appropriate?
apropos searches descriptions for the keyword.
Why this answer
apropos is specifically designed to search for keywords across all man page descriptions.
What does the 'cat' command do when provided with multiple filenames as arguments?
cat concatenates and displays the streams.
Why this answer
The cat command reads the files in the order they are listed and concatenates them to the standard output.
Which THREE of the following commands are used for file manipulation?
Copies files.
Why this answer
cp, mv, and rm are the fundamental file manipulation commands.
You need to see the last 20 lines of a file named 'access.log'. Which command is the most appropriate?
tail displays the end of the file.
Why this answer
The tail command with the -n option allows specifying the number of lines to display from the end of the file.
You want to delete a file but you are worried about accidentally deleting the wrong one. Which flag should you use with 'rm' for confirmation?
-i enables interactive prompting.
Why this answer
The -i flag makes the rm command interactive, asking for confirmation before removing each file.
Which TWO of the following are valid ways to search for files?
Real-time filesystem search.
Why this answer
find and locate are the primary search tools.
Which TWO of the following commands can be used to display the contents of a text file?
cat prints file content to stdout.
Why this answer
cat and less are both common tools for reading file contents.
When using the 'man' command, how do you navigate to the next page of the manual entry?
Spacebar scrolls forward one full page.
Why this answer
The spacebar is the standard key to scroll forward one full screen in most pager applications, including the man viewer.
Which THREE of the following represent ways to refer to the home directory?
Tilde is the shell alias for home.
Why this answer
~, $HOME, and the absolute path are all ways to reference home.
You want to delete a directory named 'temp_backup' that contains several files. Which command will successfully remove it and its contents?
-r allows for recursive deletion of directory trees.
Why this answer
The -r (recursive) flag is required for rm to delete directories and their contents.
Which command would you use to list files in long format, sorted by modification time, with the newest files appearing first?
-l is long, -t is sort by time, -r reverses order.
Why this answer
The -l (long), -t (time), and -r (reverse) flags together achieve this.
How do you rename a file named 'oldname' to 'newname' using the command line?
mv renames a file by moving it to the same directory with a new name.
Why this answer
The mv (move) command is used for both moving and renaming files.
Which command is used to clear the terminal screen?
clear empties the terminal display.
Why this answer
The clear command wipes the current terminal output.
Which shell variable typically contains the directories searched for command executables?
$PATH stores the location of executables.
Why this answer
The PATH variable holds the colon-separated list of directories the shell searches for commands.
You need to move a file named 'data.txt' from the current directory to '/var/logs' but want to be prompted if a file with the same name already exists in the destination. Which option should you add to 'mv'?
-i enables interactive mode to prompt before overwrite.
Why this answer
The -i (interactive) flag prompts the user before overwriting existing files.
Which TWO of the following are valid ways to get help on a Linux system?
man pages are standard.
Why this answer
The man and info commands are the primary documentation systems.
You are currently in a directory and want to find files ending in '.conf' within the current folder and its subfolders. Which command is correct?
find searches recursively by default.
Why this answer
The find command is the tool for searching the filesystem based on criteria like name.
Which TWO of the following commands help you move within the directory structure?
Changes working directory.
Why this answer
cd and popd allow moving between directories.
Which THREE of the following commands are used for viewing file metadata or status?
Shows permissions and owner.
Why this answer
ls, stat, and file all provide information about files.
Which THREE of the following are components of a standard Linux file path?
The starting point.
Why this answer
Root, directories, and filenames are components of a path.
You are browsing a directory and need to see hidden files alongside regular files. Which command achieves this?
The -a option includes files starting with a dot.
Why this answer
The -a (all) flag is required for ls to display hidden files starting with a dot.
You have created a script but it is not executable. Which command should you use to give the owner execute permissions?
u+x grants execute permissions to the user.
Why this answer
The chmod command is used to change file permissions, and u+x adds execute permission for the user.
You need to append the output of a command to an existing file without overwriting it. Which operator should you use?
This appends to the file.
Why this answer
The >> operator appends output to a file.
You are trying to find the location of a binary file, specifically the 'ls' command. Which command is best suited for this?
which returns the pathname of the executable.
Why this answer
The 'which' command finds the location of an executable in the user's PATH.
You want to create a symbolic link named 'link_to_file' that points to 'original_file'. Which command is correct?
-s specifies a symbolic link.
Why this answer
The ln -s command is used to create symbolic links.
Which TWO of the following flags can be used with 'ls' to modify its output?
-a shows hidden files.
Why this answer
-l and -a are very common flags for ls.
What is the purpose of the '..' notation in a file path?
.. references the directory above the current one.
Why this answer
.. refers to the parent directory of the current directory.
What is the purpose of the 'tee' command?
tee acts like a T-junction in a pipe.
Why this answer
The tee command reads from standard input and writes to both standard output and one or more files.
Which command provides a brief summary of what a specific command does without opening the entire man page?
whatis displays a one-line summary.
Why this answer
The whatis command provides a one-line description for a command name.
You are using the 'less' command to view a large log file. Which key do you press to search forward for a specific string?
The forward slash prompts for a regex to search forward.
Why this answer
The forward slash (/) character is the standard key to initiate a forward search in less.
Which TWO of the following are valid ways to create a directory?
install can create directory structures.
Why this answer
mkdir is the standard command, and install with -d is a less common but valid method.
When using 'man', what does the section number '5' refer to?
Section 5 defines file formats.
Why this answer
Section 5 of the manual pages is reserved for file formats and conventions.
You need to search for a specific command description within the manual pages using a keyword. Which command should you use?
-k searches through the short descriptions of man pages.
Why this answer
The man -k command (or apropos) searches the manual page descriptions for keywords.
Which of the following commands is used to create an empty file or update the timestamp of an existing file?
touch creates files or updates timestamps.
Why this answer
The touch command creates an empty file if it does not exist or updates access/modification times if it does.
Which TWO of the following are valid ways to list directory contents?
The standard command.
Why this answer
ls and dir are both valid commands for listing files.
You are currently in '/home/user/docs' and need to move to '/etc'. Which command is correct?
Absolute paths start with /.
Why this answer
cd /etc uses an absolute path to jump directly to the target directory.
Which THREE of the following are types of manual page sections?
Section 1.
Why this answer
User commands, system calls, and file formats are core man page sections.
You are copying a directory named 'source' to 'destination' and want to ensure all subdirectories and file attributes are preserved. Which flag is essential?
-a (archive) preserves everything and is recursive.
Why this answer
The -a (archive) flag is the most efficient way to preserve attributes, permissions, and handle recursive copies.
You are logged into a terminal and want to identify your current working directory. Which command should you execute?
pwd prints the name of the current working directory.
Why this answer
The pwd command displays the absolute path of the directory you are currently in.
To see the contents of a directory, which command is standard?
ls is the standard tool for listing contents.
Why this answer
The ls command is the standard tool for listing directory contents.
Which TWO of the following options can be used with 'rm' to ensure safe operation?
Prompts once if deleting more than 3 files.
Why this answer
-i and -I provide safety measures during deletion.
What is the primary difference between 'man' pages and 'info' pages?
Info is designed as a hypertext system.
Why this answer
Info pages are generally more detailed, hierarchical, and often contain hyperlinks, whereas man pages are typically concise, technical summaries.
Which THREE of the following are valid directory navigation commands?
pushd changes directory while saving the location on a stack.
Why this answer
cd, pwd, and pushd are all used for directory management.
Ready to test yourself?
Try a timed practice session using only Finding Your Way ON A Linux System questions.