Workbook Questions 2.20 Flashcards

1
Q
  1. Identify the root user’s home directory in Linux.

A. /
B. /root/home
C. /home/root
D. /root

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. The Linux command that allows for deleting a directory, but only if it is empty:
    A. mv -u
    B. rm
    C. rmdir
A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. The Linux command that will display the current working directory
    A. pwd
    B. cd
    C. mkdir
    D. ls
A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. Identify the redirection operator, that will not overwrite an existing file but will append it.
    A. >
    B.&raquo_space;
    C. |
A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. Identify the operator that will stream the output of the first command and send it as input to the second command.
    A. >
    B.&raquo_space;
    C. |
    D. ;
A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. Identify the command that will rename a file in Linux.
    A. ren
    B. rename
    C. cp
    D. mv
A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly