Unix - Study Mode
[#1011] Which of the following options will be used to display number of blocks used by a file?
Correct Answer
(D) -s
Explanation
Solution: In Unix, the du command is used to estimate file space usage. The -s option, when used with du , displays only a summary of the disk usage, including the total number of blocks used by a file or directory. So, -s is the option used to display the number of blocks used by a file.
[#1012] Which option will be used with touch command to change the access time?
Correct Answer
(A) -a
Explanation
Solution: In Unix, the touch command is used to change file timestamps, including access (atime) and modification (mtime) times. The -a option, when used with touch , updates only the access time of the file to the current time without modifying the file's content. So, -a is the option used with the touch command to change the access time of a file.
[#1013] Which command is used to make all files and sub-directories in the directory (progs) executable by all users?
Correct Answer
(A) chmod -R a+x progs
Explanation
Solution: In Unix, the chmod command is used to change the permissions of files and directories. The -R option is used to recursively change permissions for the specified directory and its subdirectories. The a+x part of the command grants execute permission to all users (owner, group, and others). So, chmod -R a+x progs makes all files and subdirectories in the progs directory executable by all users. Therefore, Option A is the correct command to achieve the desired task.
[#1014] Which command is used for extracting the details of the operating system?
Correct Answer
(C) uname
[#1015] For taking patterns from a file, -f option is specified with grep command.
Correct Answer
(A) True