Tag: unix

Questions Related to unix

  1. cd .

  2. cd ..

  3. cd ~

  4. cd


Correct Option: B

How do you delete a file?

  1. mv filename

  2. cp filename

  3. rm filename

  4. rm -rf *


Correct Option: C

AI Explanation

To delete a file, you can use the rm command in a terminal. Let's go through each option to understand why it is correct or incorrect:

Option A) mv filename - This option is incorrect because the mv command is used to move or rename files, not delete them.

Option B) cp filename - This option is incorrect because the cp command is used to copy files, not delete them.

Option C) rm filename - This option is correct because the rm command is used to remove/delete files. By providing the filename as an argument, you can delete the specific file.

Option D) rm -rf * - This option is incorrect because the rm -rf * command is used to forcefully delete all files and directories in the current directory. It is a dangerous command and should be used with caution.

The correct answer is Option C) rm filename. This option is correct because it uses the rm command to delete the specified file.

  1. rm directory

  2. mv directory

  3. cd directory

  4. rmdir directory


Correct Option: D
  1. mv oldfilename newfilename

  2. touch oldfilename newfilename

  3. cp oldfilename newfilename

  4. rm -rf *


Correct Option: A

Which command is used to make all files and sub-directories in the directory (progs) executable by all users?

  1. chmod -R a+x progs

  2. chmod -R 222 progs

  3. chmod -1 a+x progs

  4. None of the above


Correct Option: A

Which option will be used with touch command to change the access time?

  1. -a

  2. -b

  3. -t

  4. none of the above


Correct Option: A
  1. standard input file

  2. standard output file

  3. both input and output file

  4. neither standard input nor standard output file


Correct Option: D

Which of the following commands is used to identify the type of file by context?

  1. ls

  2. cat

  3. file

  4. more


Correct Option: C