본문 바로가기

Develop/Linux

File remove except the last five files

]$ ls -t | tail -n +6  | xargs rm -rf

with Removed list

]$ ls -t | tail -n +6 && ls -t | tail -n +6  | xargs rm -rf