Unix - Study Mode

[#701] Which of the following commands is used to update access and modification times of a file?
Correct Answer

(C) touch

Explanation

Solution: In Unix, the touch command is used to update access and modification times of a file. If the file specified doesn't exist, touch creates an empty file with the specified name. So, touch is the correct command to update access and modification times of a file.

[#702] Which command is used to count just the number of characters in a file?
Correct Answer

(B) wc -c

Explanation

Solution: In Unix, the wc command is used to count words, lines, and characters in a file. The -c option specifically instructs wc to count just the number of characters in the file. So, wc -c is the correct command to count just the number of characters in a file.

[#703] Which of the following commands is used to list contents of directories?
Correct Answer

(A) ls

Explanation

Solution: In Unix, the ls command is used to list the contents of directories. It displays the names of files and directories in the specified directory. So, ls is the correct command to list contents of directories.

[#704] Which command is used to display a file contents in octal form?
Correct Answer

(B) od

Explanation

Solution: In Unix, the od command is used to display file contents in octal form. It stands for "octal dump". So, od is the correct command to display a file's contents in octal form.

[#705] Which command will be used with vi editor to insert text to left of cursor?
Correct Answer

(D) i

Explanation

Solution: In the vi editor, the i command is used to insert text before the cursor position. Conversely, the a command is used to insert text after the cursor position. Therefore, to insert text to the left of the cursor, you would use the i command. So, i is the command used with the vi editor to insert text to the left of the cursor.