- Prison Code Breaker Diary -

=> aka: Nhật Kí Code Tù

Categories

There are various ways to delete files in Linux like:

+ rm
+ unlink
+ rename

Personally, I always use [rm] since it's short and supports cool options for file-deleting.

1. Delete one single file


$ rm file_name

2. Delete all files start w/ letter 'x'

$ rm x*

3. Delete all files end w/ string 'conf'

$ rm *conf

4. Delete all files in the current directory

$ rm *.*

5. Prompt before delete file

$ rm -i file_name

6. Delete all files w/o prompting

$ rm -f *.*

7. Delete recursively from files to directories w/o prompting

$ rm -f -r *.*

8. Get help for deleting

$ rm --help


Have fun!@

0 comments

Post a Comment