Answers for "linux delete content from files"

CSS
1

linux remove files except

/* " Be Careful !!! This will delete your folders recursively !!! " 
The below script was used to remove all files exept the last 5 in a pipline 
The ls -1v sorts the folders ascending by number. 
*/
sudo ls -1v | head -n -5 | xargs rm -r
Posted by: Guest on September-09-2021
1

delete all files in linux

Deletes all files in current directory, including hidden

rm -rf {,.[!.],..?}*
Posted by: Guest on September-02-2021
0

linux delete content of folder

//Deletes the folder including all its content
rm -r /path/to/directory/*
Posted by: Guest on June-15-2021

Code answers related to "linux delete content from files"

Browse Popular Code Answers by Language