Podcast
Questions and Answers
If the current directory is /usr/local/bin, what happens when you execute cd../../sbin/?
If the current directory is /usr/local/bin, what happens when you execute cd../../sbin/?
- /usr/local/sbin
- /usr/sbin (correct)
- /sbin
- /local/sbin
- /usr/bin
What happens after executing the command mkdir a b c ; mv a b c in an empty directory?
What happens after executing the command mkdir a b c ; mv a b c in an empty directory?
- the directories a, b, and c are moved to the directory c
- the directories a and b are appended to the directory c
- an error message: mv: target 'c' is not a directory
- the directories a and b are moved into the directory c (correct)
- the directories a, b, and c are moved to the current directory
What do three dots (...) mean in a manual page SYNOPSIS section?
What do three dots (...) mean in a manual page SYNOPSIS section?
- a hidden directory
- no special meaning
- something that is repeated (correct)
- the parent directory
- something that is optional
What is the simplified pathname for /../../var/./a/../../var/b/../../etc/./bar/../a./etc?
What is the simplified pathname for /../../var/./a/../../var/b/../../etc/./bar/../a./etc?
What is the Linux command name apropos a synonym for?
What is the Linux command name apropos a synonym for?
What happens after this command: cp foo/bar ./foo/../me?
What happens after this command: cp foo/bar ./foo/../me?
If the current directory is Assignments, what pathname could you use to change to directory CST8207-19W?
If the current directory is Assignments, what pathname could you use to change to directory CST8207-19W?
If you are in directory /home/me and mt is an empty sub-directory, what is true after this command line: touch foo ; mv ./mt/../foo../me/bar?
If you are in directory /home/me and mt is an empty sub-directory, what is true after this command line: touch foo ; mv ./mt/../foo../me/bar?
What happens when you execute the command mkdir a b c; mv a b c?
What happens when you execute the command mkdir a b c; mv a b c?
What is the function of the mv command in Linux?
What is the function of the mv command in Linux?
When you first log in to a Linux system, which directory are you placed in?
When you first log in to a Linux system, which directory are you placed in?
What is the command to search for a pattern inside files?
What is the command to search for a pattern inside files?
If your current directory is /bin, which of the following pathnames is equivalent to the file name /bin/ls?
If your current directory is /bin, which of the following pathnames is equivalent to the file name /bin/ls?
What command creates a directory and all parent directories?
What command creates a directory and all parent directories?
What do you do to erase an entire line of typing in the shell?
What do you do to erase an entire line of typing in the shell?
What is the shell meta-character used to separate multiple separate commands on the same line of typing?
What is the shell meta-character used to separate multiple separate commands on the same line of typing?
What is the minimum number of directories in this pathname: /a/b/c/d
What is the minimum number of directories in this pathname: /a/b/c/d
What is the absolute pathname of the Unix/Linux password (account) file?
What is the absolute pathname of the Unix/Linux password (account) file?
What command can you use to delete a directory that isn’t empty?
What command can you use to delete a directory that isn’t empty?
To indicate End-of-File (no more input) to a program, what do you type?
To indicate End-of-File (no more input) to a program, what do you type?
What does a dot (period) that begins a name signify in the output of the command ls -a?
What does a dot (period) that begins a name signify in the output of the command ls -a?
If my current directory is /etc, which of these pathnames is equivalent to the file name /etc/passwd?
If my current directory is /etc, which of these pathnames is equivalent to the file name /etc/passwd?
To leave a shell and let the terminal window close, what command should be typed?
To leave a shell and let the terminal window close, what command should be typed?
In an empty directory, what happens after this command line: touch a b c ; mv a b c
In an empty directory, what happens after this command line: touch a b c ; mv a b c
If a shell token with a GLOB pattern contains two slashes, how many slashes can be in each matched pathname?
If a shell token with a GLOB pattern contains two slashes, how many slashes can be in each matched pathname?
If /etc/passwd is a file name, which pathname almost always leads to the same file?
If /etc/passwd is a file name, which pathname almost always leads to the same file?
Which command line below does not show any lines from inside the file out?
Which command line below does not show any lines from inside the file out?
If my current directory is /home, and my HOME directory is /home/me, which command copies the password file into my HOME directory under the name foo?
If my current directory is /home, and my HOME directory is /home/me, which command copies the password file into my HOME directory under the name foo?
What command displays the sizes of files in the current directory?
What command displays the sizes of files in the current directory?
What is the result of this exact command line: cat /foo bar
What is the result of this exact command line: cat /foo bar
Study Notes
Linux Command Line Essentials
- To move up two directories, use
cd ../../
(question 81) - The
mkdir
command creates directories, andmv
command moves or renames files/directories (question 82) - In a manual page SYNOPSIS section, ellipsis (...) means something is repeated (question 83)
Pathnames and Directories
cd ../../sbin/
leads to/usr/sbin
(question 81)mkdir a b c ; mv a b c
moves directoriesa
andb
into directoryc
(question 82)/../../var/./a/../../var/b/../../etc/./bar/..
simplifies to/etc/bar
(question 84)apropos
is a synonym forman -k
(question 85)
File Operations
cp foo/bar ./foo/../me
copies the filefoo/bar
tome
(question 86)mkdir
creates directories, andtouch
creates empty files (question 87)mv foo/bar ./mt/../foo../me/bar
moves the filefoo/bar
tome/bar
(question 88)ls -a
displays all files, including hidden files with dot (.) prefix (question 89)
Shell and Utilities
- To exit a shell, type
exit
(question 91) man -k compile
lists all utilities available for compiling programs (question 99)cat /foo bar
displays the contents of files/foo
andbar
(question 101)
File Systems and Navigation
cd
changes the current directory, andpwd
displays the current directory (question 104)..
refers to the parent directory (question 105)mkdir -p a/b/c
creates directorya/b/c
and all parent directories (question 107)
Shell Shortcuts and Meta-Characters
;
is used to separate multiple commands on the same line (question 109)CTRL-U
erases an entire line of typing (question 108)a.
is used to indicate the current directory (question 110)
File Management
rmdir -r a/b/c
removes directorya/b/c
and all parent directories (question 107)rm -r dir
deletes a directory and all its contents (question 114)del
is not a standard Unix/Linux command (question 114)
Miscellaneous
CTRL-D
sends an EOF (end-of-file) and takes you back to the command prompt (question 113)cd /home/foo ; mkdir bar ; touch bar/a ; pwd
outputs/home/foo
(question 116)file
command determines the type of a file or directory (question 119)TAB
key can be used to complete commands or file names in bash (question 120)
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge of Unix command line navigation and file management with these questions.