Search code examples
linuxrm

Deleting multiple files in Linux?


How can I delete multiple files in Linux created at same date and time? How can I manage this without using date? The file have different names.

I have these .txt files:

-rw-r--r-- 1 root root        54 Jan  6 17:28 file1.txt
-rw-r--r-- 1 root root        33 Jan  6 17:28 file2.txt
-rw-r--r-- 1 root root        24 Jan  6 18:05 file3.txt
-rw-r--r-- 1 root root         0 Jan  6 17:28 file4.txt
-rw-r--r-- 1 root root         0 Jan  6 17:28 file5.txt

How can I delete all the files with one command?


Solution

  • simply use rm -f file*.txt to delete all files which starts with file and ends with the extention .txt