우분투 기본 사용방법
알게 되는 순서대로 기록하는 우분투 기본 사용방법 기록 페이지입니다.
2021. 11. 10 최초작성
1. 지정한 디렉토리 크기 확인
$ du -sh /home/webnautes
834M /home/webnautes
2. zip를 사용하여 하위 폴더까지 압축하기
/var/log 아래에 있는 하위 디렉토리를 포함하여 log.zip 파일로 압축됩니다.
$ zip -r log.zip /var/log/
adding: var/log/ (stored 0%)
adding: var/log/apt/ (stored 0%)
adding: var/log/apt/term.log (deflated 87%)
adding: var/log/apt/history.log (deflated 79%)
adding: var/log/apt/eipp.log.xz (deflated 0%)
adding: var/log/dist-upgrade/ (stored 0%)
adding: var/log/journal/ (stored 0%)
adding: var/log/fontconfig.log (deflated 81%)
adding: var/log/gdm3/ (stored 0%)
adding: var/log/private/ (stored 0%)
adding: var/log/wtmp (stored 0%)
adding: var/log/lastlog (deflated 100%)
adding: var/log/unattended-upgrades/ (stored 0%)
adding: var/log/btmp
zip warning: Permission denied
zip warning: could not open for reading: var/log/btmp
adding: var/log/dpkg.log (deflated 91%)
adding: var/log/alternatives.log (deflated 87%)
adding: var/log/landscape/ (stored 0%)
adding: var/log/ubuntu-advantage.log
zip warning: Permission denied
zip warning: could not open for reading: var/log/ubuntu-advantage.log
zip warning: Not all files were readable
files/entries read: 16 (1.1M bytes) skipped: 2 (0 bytes)
3. unzip를 사용하여 특정 디렉토리에 압축 풀기
-d 다음에 압축을 해제할 경로를 적어줘야 합니다.
압축 파일 이름은 압축해제되는 경로에 포함되지 않음을 볼 수 있습니다.
$ unzip log.zip -d ./tmp
Archive: log.zip
creating: ./tmp/var/log/
creating: ./tmp/var/log/apt/
inflating: ./tmp/var/log/apt/term.log
inflating: ./tmp/var/log/apt/history.log
inflating: ./tmp/var/log/apt/eipp.log.xz
creating: ./tmp/var/log/dist-upgrade/
creating: ./tmp/var/log/journal/
inflating: ./tmp/var/log/fontconfig.log
creating: ./tmp/var/log/gdm3/
creating: ./tmp/var/log/private/
extracting: ./tmp/var/log/wtmp
inflating: ./tmp/var/log/lastlog
creating: ./tmp/var/log/unattended-upgrades/
inflating: ./tmp/var/log/dpkg.log
inflating: ./tmp/var/log/alternatives.log
creating: ./tmp/var/log/landscape/