Unix - Study Mode
[#1006] Which of the following commands is used to obtain a list of all files by modification time?
Correct Answer
(B) ls -t
Explanation
Solution: In Unix, the ls command is used to list directory contents. The -t option with ls is used to sort files by modification time, showing the most recently modified files first. So, ls -t is the command used to obtain a list of all files sorted by modification time.
[#1007] The % key allows you
Correct Answer
(A) to move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace.
Explanation
Solution: In Unix terminal environments, the % key, when used with certain text editors like vi or vim, allows the cursor to jump to the matching delimiter (such as parenthesis, bracket, or brace) in the text. This feature helps in navigating through code or text files efficiently, especially in programming or scripting contexts. So, Option A is the correct description of what the % key allows you to do.
[#1008] Which command is used to display the characteristics of a process?
Correct Answer
(C) ps
Explanation
Solution: In Unix, the ps command is used to display information about active processes. By default, it shows a brief list of processes running in the current terminal session, including their process IDs (PIDs), terminal IDs (TIDs), and other characteristics such as CPU and memory usage. So, ps is the command used to display the characteristics of a process.
[#1009] Which of the following commands is used to identify the type of file by context?
Correct Answer
(C) file
Explanation
Solution: In Unix, the file command is used to determine the type of a file by examining its contents and context. When you run file followed by a filename as an argument, it analyzes the file and provides information about its type, such as whether it is a text file, binary file, directory, symbolic link, etc. So, file is the command used to identify the type of file by context.
[#1010] The field separator in cut command is specified with
Correct Answer
(B) -a option
Explanation
Solution: In Unix, the cut command is used to extract sections from each line of input. The field separator, which specifies how the fields are separated in the input, is specified using the -d option followed by the delimiter character. For example, if you want to use a comma as the field separator, you would use cut -d',' . So, -d option is used to specify the field separator in the cut command.