Managing Files, Directories, and Text Flashcards

1
Q
You are looking at a directory that you have not viewed in a long time and need to determine which files are actually ls -ddirectories.
Which command is the best one to use?
A. mkdir -v
B. ls
C. ls -F
D. ls -i
E. ll
A

C. ls -F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
You are using the ls command to look at a directory file's metadata but keep seeing meta-data for the files within in it instead. What command option will rectify this situation?
A. -a
B. -d
C. -F
D. -l
E. -R
A

B. -d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
You have just created an empty directory called MyDir. Which command most likely did you use?
A. mkdir -v MyDir
B. touch MyDir
C. cp -R TheDir MyDir
D. mv -r TheDir MyDir
E. rmdir MyDir
A

A. mkdir -v MyDir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
You have a file that is over 10GB in size, and it needs to be backed up to a locally attached drive. What is the best utility to use in this situation?
A. readlink -f
B. mv
C. cp
D. scp
E. rsync
A

E. rsync

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A long-time server administrator has left the company, and now you are in charge of her system. Her old user account directory tree, /home/Zoe/, has been backed up. Which command is the best one to use to quickly remove her files?
A. cp -R /home/Zoe/ /dev/null/
B. mv -R /home/zoe/ /dev/null/
C. rm -Rf /home/Zoe/
D. rm -ri /home/Zoe/
E. rm -rI /home/Zoe
A

E. rm -rI /home/Zoe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
There is a large directory structure that needs to be renamed. What mv command options should you consider employing? (Choose all that apply.)
A. -f
B. -i
C. -n
D. -r
E. -v
A

B. -i

D. -r

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

You are trying to decide whether to use a hard link or a symbolic link for a data file. The file is 5GB, has mission-critical data, and is accessed via the command line by three other people. What should you do?
A. Create a hard link so the file can reside on a different filesystem for data protection.
B. Create three hard links and provide the links to the three other people for data protection.
C. Create three symbolic links and protect the links from the three other people for data protection.
D. Create a symbolic link so the file can reside on a different filesystem
E. Create a symbolic link so the links can share an inode number.

A

A. Create a hard link so the file can reside on a different filesystem for data protection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A short text-based control file is no longer working properly with the program that reads it. You suspect the file was accidentally corrupted by a control code update you performed recently, even though the file's control codes are all correct. Which command should you use next on the file in your problem investigation?
A. cat -v
B. cat -z
C. cat -n
D. cat -s
E. cat -E
A

A. cat -v

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
You have two short text files that have maximum record lengths of 15 characters. You want to review these files side by side. Which of the following commands would be the best to use?
A. pr -m
B. pr -tl 20
C. cat
D. pr -mtl 20
E. pr - ml 20
A

D. pr -mtl 20

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

You have a lengthy file named, FileA.txt. What will the head -15 FileA.txt command do?
A. Display all but the last 15 lines of the file.
B. Display all but the first 15 lines of the file.
C. Display the first 15 lines of the file.
D. Display the last 15 lines of the file.
E. Generate an error message.

A

C. Display the first 15 lines of the file.

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

You have issued the command grep Hal on a text file you generated using information from a failed login attempts file. It returns nothing, but you just performed a test case, by purposely failing to log into the Hal account, prior to generating the text file. Which of the following is the best choice as your next step?

A. Employ the tail command to peruse the text file.
B. Employ the cat command to view the text file.
C. Delete the text file and regenerated it using information from the failed login attempts file.
D. Issue the grep -d skip Hal command on the text file.
E. Issue the grep -i Hal command on the text file.

A

A. Employ the tail command to peruse the text file.

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

Your are trying to peruse a rather large text file. A coworker suggests you use a pager. Which of the following best describes what your coworker is recommending?
A. Use a utility that allows you to view the first few lines of the file.
B. Use a utility that allows you the view one text page at time.
C. Use a utility that allows you to search through the file.
D. Use a utility that allows you to filter out text in the file.
E. Use a utility that allows you to view the last few lines of the file.

A

A. Use a utility that allows you to view the first few lines of the file.

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

Which of the following does not describe the less utility?
A. It does not read the entire file prior to displaying the file’s first page.
B. You can use the up and down arrow keys to move through the file.
C. You press the spacebar to move forward a page.
D. You can use the Esc+V key combination to move backward a page.
E. You can press the X key to exit from the utility.

A

A. It does not read the entire file prior to displaying the file’s first page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
Which diff option is the best option to allow you to quickly determine if two text files are different from one another?
A. -e
B. -q
C. -s
D. -W
E. -y
A

A. -e

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

You are working on a Linux server at the command line, and you try to issue a diff command and receive a response stating the command was not found. What is the next best step to take in order to start the troubleshooting process?
A. Hit your up arrow key and press Enter.
B. Log out, log back in, and retry the command.
C. Enter the which diff command.
D. Enter the whereis diff command.
E. Reboot the server and retry the command.

A

A. Hit your up arrow key and press Enter.

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

You are trying to find a file on your Linux server whose name is conf. Employing the locate conf command for your search shows many directories that contain the letters conf. What is the best description for why this is happening?
A. The locate utility searches for only for directory names.
B. You did not employ the -d skip switch.
C. It is most likely because the locate database is corrupted.
D. You did not employ the appropriate regular expression.
E. It is due to file globbing on the pattern name.

A

A. The locate utility searches for only for directory names.