Contents
To delete multiple files at once, use the rm command followed by the file names separated by space. When using regular expansions, first list the files with the ls command so that you can see what files will be deleted before running the rm command.
How do I delete all TXT files in Linux?
The Basics of Using rm to Delete a File
- Delete a single file using rm : rm filename.txt.
- Delete multiple files: rm filename1.txt filename2.txt.
- Delete all .txt files in the directory: rm *.txt.
How do you delete multiple files at once?
Hold down the “CTRL” key on your keyboard. Click the other files you wish to delete while continuing to hold down the “CTRL” key. This will select multiple files at once. Release the “CTRL” key and then press the “Delete” key on your keyboard.