Tar
# basic
tar -czvf file.tar.gz file_path
# skip bulky/throwaway files for a leaner archive
tar -czvf output.tar.gz --exclude='data' --exclude='*.log' --exclude='*.tmp' target_folder/
# create the destination first, then extract into it,
# stripping the original top-level directory name
mkdir -p new_folder
tar -xzvf file.tar.gz -C new_folder --strip-components=1
SCP
- Download (remote → local)
# single file
scp user@host:/home/user/file.txt /local/path/
# whole directory
scp -r user@host:/home/user/project/ /local/path/
# single file
scp /local/file.txt user@host:/home/user/
# whole directory
scp -r /local/project/ user@host:/home/user/
Summary
scp (-r [from] [to]
Disk Usage
- "How full is the disk?" — whole filesystem overview
df -h
- "How big is this directory?" — single total
du -sh /path/to/dir