Managing Files, Directories, and Text Flashcards
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
C. ls -F
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
B. -d
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. mkdir -v MyDir
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
E. rsync
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
E. rm -rI /home/Zoe
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
B. -i
D. -r
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. Create a hard link so the file can reside on a different filesystem for data protection.
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. cat -v
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
D. pr -mtl 20
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.
C. Display the first 15 lines of the file.
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. Employ the tail command to peruse the text file.
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. Use a utility that allows you to view the first few lines of the file.
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. It does not read the entire file prior to displaying the file’s first page.
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. -e
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. Hit your up arrow key and press Enter.