Skip to content

Instantly share code, notes, and snippets.

@emrahoruc
Last active June 8, 2024 14:27
Show Gist options
  • Save emrahoruc/c91c6ed4f945a67f73d4c93646e416e9 to your computer and use it in GitHub Desktop.
Save emrahoruc/c91c6ed4f945a67f73d4c93646e416e9 to your computer and use it in GitHub Desktop.
Linux Command Lines

Compress

tar -cvzf backup.tgz /home/user/project

Extract

tar -xvzf backup.tgz

Copy Lots And Large Files

rsync -avhW --no-compress --progress --exclude 'file_or_dir' /source/ /target/

Reset Permissions

cd /home/user/domains/domain.com/public_html
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;

Alsamixer - Unmute speaker, unmute headset microphone, set mic boost right 0 and left 100

amixer -c1 set 'Speaker' unmute 100
amixer -c1 set 'Mic' unmute 100
amixer -c1 set 'Mic Boost' 0,100

Find & Remove error_log Files in Linux

find . -type f -iname error_log -exec du -sh {} \;
find . -type f -iname error_log -delete

Copy part of files from huge directory

ls | head -n 80000 | tail -n 5 | xargs -I{} cp {} /target/directory

Listen network traffic

tcpdump -A host 192.168.1.100
tcpdump -A port 80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment