ServerCake India

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

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*

Editorial Team

Editorial Team at ServerCake India Blog is a team of experts in Server Administration, Business Development, Management, SEO Analyst & Graphic Designers with more than 5+ years of expertise.

Add comment