OS Admin and Security - Chapter 6
The Linux command line interface is called a ______
Shell
Shill
A program that takes input, evaluates syntax, provides output
Case
Shell
A screen where we can type any command.
Shell
Structure
Unix has ______ common shells
Three
Two
______ was written by Bill Joy; good for interactive use
C shell
Bourne shell
C shell was written by ______; good for interactive use
Steven Bourne
Bill Joy
C shell was written by Bill Joy; good for ______
Interactive use
Scripts
______ was written by Steven Bourne; good for scripts
C shell
Bourne shell
Bourne shell was written by ______; good for scripts
Steven Bourne
Bill Joy
Bourne shell was written by Steven Bourne; good for ______
Interactive use
Scripts
The default Linux shell is ______
Bash
Csh
Which of the following is true?
The default Linux shell is C shell, an advanced Bourne shell, with interactivity features from the C shell
The default Linux shell is Bourne shell, an advanced Bourne shell, with interactivity features from the C shell
The default Linux shell is Bourne Again Shell, an advanced Bourne shell, with interactivity features from the C shell
None of the above
What does bash stands for?
Bourne Allocation Shell
Bourne Again Shell
______ command accesses the Linux command manual, which provides you with syntax and usage information for any command
Man
Ls
Pwd
Cd
Which of the following is correct?
Man
To close and return from manual pages (help), press the letter ‘___’ from keyboard.
E
Q
Which command would you use to get brief help in Minimal Linux, in which manual pages aren't installed?
--help
Man
Which of the following is true?
--help works for all commands
--help doesn't work for some commands, such as 'pwd'.
Which of the following is true?
TAB key only works for commands that start with sh.
Any existing file or directory name can be completed by pressing the TAB key.
Which of the following is true?
When pressing tab key, and there are two files with similar names. The tab will not autocomplete, but rather display all the possible options.
When pressing tab key, and there are two files with similar names. The tab will autocomplete both files, and the user has to remove one of them off the command line.
______ provides a listing of all contents in a directory
Man
Ls
Pwd
Cd
Which one of the following is correct?
Ls [options] < directory >
< directory > ls [options]
Ls < directory > [options]
< directory > [options] ls
Which of the following is true for 'ls' command?
If no directory is given, then an error message will appear
If no directory is given, then the current directory is used
Shows details such as file type, size, permissions, owner, and last modification date
Ls -l
Ls -a
Shows all files, including hidden files (these start with .)
Ls -l
Ls -a
______ commond shows the absolute path of your current working directory, that is, from the top of the file system
Man
Ls
Pwd
Cd
The top or start of the file system is denoted by ___
/
*
______ allows you to move from one directory to another in the file system
Man
Ls
Pwd
Cd
Which one of the following is correct?
< directory > cd
Cd < directory >
Takes you one step up in the file system
Cd ..
Cd foo
Cd /home/stu
Cd and cd ~
Takes you to the foo subdirectory of your current directory (assuming there is one)
Cd ..
Cd foo
Cd /home/stu
Cd and cd ~
Takes you to the /home/stu directory, whatever your current directory is
Cd ..
Cd foo
Cd /home/stu
Cd and cd ~
Take you to your own home directory
Cd ..
Cd foo
Cd /home/stu
Cd and cd ~
______ creates a new directory in the file system
Mkdir
Clear
Reset
Touch
Which one of the following is correct?
Mkdir < directory >
< directory > mkdir
______ creates a subdirectory of your current directory called foo
Mkdir /home/stu/stufoo
Mkdir foo
______ creates a subdirectory of /home/stu called stufoo, regardless of your current directory
Mkdir /home/stu/stufoo
Mkdir foo
______ clears the shell
Mkdir
Clear
Reset
Touch
______ is helpful if you have been working in a shell for a while and it has gotten cluttered
Mkdir
Clear
Reset
Touch
______ clears the shell and restores it to its default functionality
Mkdir
Clear
Reset
Touch
______ is helpful if you have displayed the contents of a program file in the shell, and the shell is no longer behaving properly
Mkdir
Clear
Reset
Touch
If the shell is no longer behaving properly, and things have gotten really bad. What should you do?
Ctrl-Z clear Ctrl-Z
Ctrl-J reset Ctrl-J
______ creates an empty file
Mkdir
Clear
Reset
Touch
Which one of the following is correct?
File_name [opt] touch
[opt] touch file_name
Touch [opt] file_name
[opt] file_name touch
Which one of the following is true for command 'touch'?
If the file already exists, then the modification time is changed to the current time
If the file already exists, then the old file is changed to the new file
______ allows you to move a file to a new directory, or to rename a file in its current directory
Mv
Cp
Rm
Rmdir
Which of the following is correct?
Mv [opt] directory src_file
Mv [opt] src_file directory
With mv command, you can specify one or more files to move.
True
False
Which of the following is correct?
Mv [opt] src_name dst_name
Mv [opt] dst_name src_name
Interactive, always prompts you before you overwrite a file
Mv –v
Mv –i
Verbose, explains what is going on
Mv –v
Mv –i
______ allows you to copy a file
Mv
Cp
Rm
Rmdir
Which one of the following is correct?
Cp [opt] directory src_file
Cp [opt] src_file directory
Copies the file to another directory (same name)
Cp [opt] src_file directory
Cp [opt] src_name dst_name
When using the 'cp' command, you can specify one or more files to copy.
True
False
Copies the file to its own directory (new name)
Cp [opt] src_file directory
Cp [opt] src_name dst_name
Interactive, prompts you before you overwrite a file
Cp –i
Cp –p
Cp –r
None of the above
Preserve file attributes (permissions, ownership, timestamps)
Cp –i
Cp –p
Cp –r
None of the above
Recursive, copies all files and subdirectories
Cp –i
Cp –p
Cp –r
None of the above
______ removes (deletes) files and directories
Mv
Cp
Rm
Rmdir
Which one of the following is correct?
File [opt] rm
Rm [opt] file
In 'rm' command, you can specify one or more files to remove
True
False
Which one of the following is true for 'rm' command?
If the file is writeable, the user will be prompted to confirm removal
If the file is unwriteable, the user will be prompted to confirm removal
Interactive, prompts you before you remove an existing file
Rm –i
Rm –r
Rm –v
None of the above
Recursive, removes all files and subdirectories of the specified directory
Rm –i
Rm –r
Rm –v
None of the above
Verbose, explains everything as it happens
Rm –i
Rm –r
Rm –v
None of the above
______ removes (deletes) empty directories
Mv
Cp
Rm
Rmdir
Which one of the following is correct?
Rmdir directory
Directory rmdir
Which one of the following is true for 'rmdir' command?
If the directory is empty, you will get an error message
If the directory is not empty, you will get an error message
______ allow you to perform operations on multiple files/directories with one command.
Wildcards
Civilizedcards
Removing touchfile, touchfile2 and touchfile~ all at once is an example of ______
Civilizedcards
Wildcards
Any string of characters
*
?
[]
{}
One character
*
?
[]
{}
Used to specify valid single characters
*
?
[]
{}
Used to specify valid strings
*
?
[]
{}
______ finds files and directories on the file system
Find
Locate
Cat
Less
Which one of the following is true for 'find' command?
For security, users get only results they have permission to read
For security, users get only results they have permission to read and write
Which one of the following is correct?
name {string} find {directory}
Find {directory} –name {string}
finds all files & directories matching string
Find {directory} –name {string}
Find –iname
Yields a case insensitive search
Find {directory} –name {string}
Find –iname
Which one of the following is true for 'locate' command?
For security, users get only results they have permission to read
For security, users get only results they have permission to read and write
Which one of the following is correct?
Name [opt] locate
Locate [opt] name
Finds all files & directories with “string” anywhere in the name
Locate string
Locate –i name
Locate – n < num >
None of the above
yields a case insensitive search
Locate string
Locate –i name
Locate – n < num >
None of the above
Locate – n < num >
Locate string
Locate –i name
Locate – n < num >
None of the above
______ works by searching a local database
Find
Locate
Cat
Less
Database is updated daily; update manually with the ______ command
Updatedb
Dbupdate
______ uses a previously built database (command updatedb). Is much faster, but uses an 'older' database and searches only names or parts of them.
Find
Locate
To get updated results with ______ command, you must run the terminal command #updatedb as root or run the command with sudo, I.e., $sudo updated
Find
Locate
To get updated results with locate command, you must run the terminal command ______ as root or run the command with sudo, I.e., $sudo updated
Updatedb
Dbupdate
To get updated results with locate command, you must run the terminal command #updatedb as ______ or run the command with sudo, I.e., $sudo updated
Administrator
Root
To get updated results with locate command, you must run the terminal command #updatedb as root or run the command with sudo, I.e., ______
Sudo updated
Updated sudo
______ searches in the real system. Is slower but always up-todate and has more options (size, modification time,...)
Find
Locate
______ displays the contents of one or more files to the screen
Find
Locate
Cat
Less
Which one of the following is correct syntax for 'cat' command?
File1 cat
Cat file1
Displays file1 on the screen
Cat file1
Cat file1 file2 > newfile
File1 and file2 are put together into newfile
Cat file1
Cat file1 file2 > newfile
______ displays the contents of a file onscreen, one screenful at a time
Find
Locate
Cat
Less
Which one of the following is the correct syntax for 'less' command?
Less
Using 'less' command, press ______ to see the next line
Enter or Down Arrow
Space Bar or Page Down
Up Arrow
Page Up
Using 'less' command, press ______ to see the next screen
Enter or Down Arrow
Space Bar or Page Down
Up Arrow
Page Up
Using 'less' command, press ______ to see the previous line
Enter or Down Arrow
Space Bar or Page Down
Up Arrow
Page Up
Using 'less' command, press ______ to see the previous screen
Enter or Down Arrow
Space Bar or Page Down
Up Arrow
Page Up
Using 'less' command, press ______ to return to the shell prompt
Space Bar or Page Down
Up Arrow
Page Up
Q
______ can also be used with other commands to prevent scrolling
Find
Locate
Cat
Less
Which one of the following is a correct execution of the command 'less'?
Less ls –al /bin
Ls –al /bin | less
Which one of the following is a correct execution of the command 'less'?
find . -name peter –print | less
Less find . -name peter –print
______ displays the first few lines of a file
Head
Tail
Grep
Gedit
______ displays the last few lines of a file
Head
Tail
Grep
Gedit
The default number of lines for both head and tail is ______
5
10
Which one of the following is correct syntax?
Head
F the following is correct syntax?
Tail
To change the number of lines when using head or tail command, use the following command:
n < num >
< num > -n
Which of the following is true?
Commands can only be redirected to head and tail
As with less & more, other commands can be redirected to head and tail
Ls –al /bin | tail –n 5 - What does "-n 5" do?
Change the number of lines to 5.
Change the number within "bin" to 5.
______ searches for all occurrences of a given pattern in a given file
Head
Tail
Grep
Gedit
Which one of the following is correct syntax for 'grep' command?
Grep pattern [opt] [file]
Grep [opt] pattern [file]
Insensitive, ignore case in the search
Grep -i
Grep [opt] pattern [file]
______ is the standard graphical text editor
Head
Tail
Grep
Gedit
If you specify a filename when you open gedit, gedit will:
Delete the file if it exists, and then create a new one
Open the file if it exists
If you specify a filename when you open gedit, gedit will:
Create a new file if the name has not been used
Create a new file with a number next to it if the name has been used
What happens if you executed 'gedit overview'?
Overview of all files will be display to the user
It will create a file called overview if it doesn’t already exist. If the file exists it will open it
______ displays commands used in the current bash session
Tail
Grep
Gedit
History
Which one of the following is the correct syntax for 'history' command?
History
History /all
Clears the history
History –c
History n
Displays only the last n commands
History –c
History n
Print working directory
Pwd
Ls
Cd
Mkdir
List directory contents
Pwd
Ls
Cd
Mkdir
Change directory
Pwd
Ls
Cd
Mkdir
Create a new directory
Pw
Ls
Cd
Mkdir
Clear the shell display
Clear
Reset
Touch
Mv
Return the shell display to defaults
Clear
Reset
Touch
Mv
Create a file
Clear
Reset
Touch
Mv
Move a file
Clear
Reset
Touch
Mv
Copy a file
Cp
Rm; rmdir
Man
Find; locate
Remove a file; remove an empty directory
Cp
Rm; rmdir
Man
Find; locate
Displays help for a command
Cp
Rm; rmdir
Man
Find; locate
Find a file
Cp
Rm; rmdir
Man
Find; locate
Display a file onscreen
Cat
Less
Head
Tail
Display a file without scrolling
Cat
Less
Head
Tail
Display the first 10 lines of a file
Cat
Less
Head
Tail
Display the last 10 lines of a file
Cat
Less
Head
Tail
Finds a string in a file
Tail
Grep
Gedit
History
A graphical text editor
Tail
Grep
Gedit
History
Displays recently used commands
Tail
Grep
Gedit
History
{"name":"OS Admin and Security - Chapter 6", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"The Linux command line interface is called a ______, A program that takes input, evaluates syntax, provides output, A screen where we can type any command.","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}