tar 압축

find `ls` -type d -maxdepth 0 -exec tar -cvf "{}.tar" "{}" \;

 

zip 압축
find `ls` -type d -maxdepth 0 -exec zip -r -9 "{}.zip" "{}" \;

 

주의사항

maxdepth가 0이라 최상위 레벨까지만 압축한다.

'Server > 기타' 카테고리의 다른 글

쉘스크립트 - 파일을 폴더 생성 후 이동  (0) 2022.06.22

+ Recent posts