📜  linux 删除文件 except - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:38.637000             🧑  作者: Mango

代码示例1
/* " 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