How Do I Delete a File in Unix?
Contents How Do You Delete a File in Linux? There Are Various Ways You Can Empty a File in a Linux System. Empty Log File Using Truncate Command. the Safest...
Contents
How do you delete a file in Linux?
There are various ways you can empty a file in a Linux system.
- Empty log file using truncate command. The safest method to empty a log file in Linux is by using the truncate command. …
- Empty log file using :> or true > …
- Empty log file using echo command. …
- Empty log file using the dd command.
2 окт. 2018 г.
Must Read
How do I find and delete a file in Unix?
Where, options are as follows:
- -name “FILE-TO-FIND” : File pattern.
- -exec rm -rf {} ; : Delete all files matched by file pattern.
- -type f : Only match files and do not include directory names.
- -type d : Only match dirs and do not include files names.
18 апр. 2020 г.