Workbook Questions 2.20 Flashcards
1
Q
- Identify the root user’s home directory in Linux.
A. /
B. /root/home
C. /home/root
D. /root
A
D
2
Q
- The Linux command that allows for deleting a directory, but only if it is empty:
A. mv -u
B. rm
C. rmdir
A
C
3
Q
- The Linux command that will display the current working directory
A. pwd
B. cd
C. mkdir
D. ls
A
A
4
Q
- Identify the command that will delete directory ∼/Images and files stored in it.
A. rmdir ∼/Images
B. rm ∼/Images
C. rmdir -p ∼/Images
D. rm -r ∼/Images
E. rm -r /Images
A
D
5
Q
- Identify the command that is used to change directory to test1, a sub-directory of user1’s home directory,
/home/user1, given the command prompt listed below:
user1@localhost:/etc$
A. cd /test1
B. cd ./test1
C. cd ../home/user1/test1
D. cd home/user1/test1
A
C
6
Q
- Identify the redirection operator, that will not overwrite an existing file but will append it.
A. >
B.»_space;
C. |
A
B
7
Q
- Identify the operator that will stream the output of the first command and send it as input to the second command.
A. >
B.»_space;
C. |
D. ;
A
C
8
Q
- What will the command echo $SHELL do?
A. it will run the default shell
B. it will show the default shell as specified in the environment variable SHELL
C. it will show all shells currently in the system
A
B
9
Q
- What does the command cat file1 file2 do?
A. redirects output of file1 to file2
B. concatenates files file1 and file2 and prints to standard output, (i.e. default - screen)
C. takes each line from file1 and appends it to corresponding line in file2.
A
B
10
Q
- What does the command touch file1 do?
A. creates file1 with zero bytes, gives an error if file1 exists.
B. creates file1 with zero bytes if it does not exist, if file1 exists touch will update the time stamp of the file.
C. creates file1 with zero bytes, if file1 exists touch overwrites and creates a file with zero bytes.
A
B
11
Q
- Identify the command that will rename a file in Linux.
A. ren
B. rename
C. cp
D. mv
A
D
12
Q
- Select one correct choice.
The history | tail command
A. will list the last 10 commands issued at the prompt
B. will list all commands issued at the prompt
C. will give an error
A
A