Which Command is used to Delete All Files in the Current Directory?

0
35
Delete file in Current Directory
Current Directory Graphical Illustration

In a current directory, all files can be deleted by using rm command.

What is rm command?

rm command is used to delete files and directories on Linux and other Unix-like operating systems.

The general syntax for rm command is  rm [options] [-r directories] filenames

The items in square brackets are optional. When just used with the names of one or more files, rm command deletes all those files without requiring confirmation by the user.

The following command deletes all the files f1,f2,f3 assuming that all three are located in the current directory rm f1,f2,f3

To delete all files in the current directory use the command rm*

LEAVE A REPLY

Please enter your comment!
Please enter your name here