os/Linux

bash find delete sort

C/H 2017. 4. 11. 08:30

Find Delete

find 폴더 -name '파일명' -mtime +일수 -delete
find 폴더 -name '파일명' -mtime +일수 -exec rm -f {} \;
find 폴더 -name '파일명' -mtime +일수 | xargs rm -f

ll --time-style full-iso | awk '{print $6" "$9}' | grep 2011-08
ll --time-style full-iso | awk '{print $6" "$9}' | grep 2011-08 | awk '{print $2}' | xargs rm -f

Sort

#File modification:
ls -t

#Inode change:
ls -tc

#File access:
ls -tu

#"Newest" one at the bottom:
ls -tr


반응형

'os > Linux' 카테고리의 다른 글

yum rpmforge Error  (0) 2017.05.04
Centos Yum history undo  (0) 2017.04.12
scp remote to remote routing  (0) 2017.04.10
Debian dpkg command  (0) 2017.03.28
ssh-keygen 자동 로그인  (0) 2017.03.23