четвер, 14 жовтня 2010 р.

Ubuntu Linux howto

Here is a small collection of useful commands that can ease your life a lot :)
I will try to update this post frequently.

Remember, you can always check parameters for each command using
man <app_name>

Get the list of modified config files in /etc:
sudo debsums -e | grep FAILED

Get package name of a given file:
apt-file search blacklist.conf

Watch all tcp/udp/raw connections:
watch -n 1.0 "netstat -tuwWpn"

Watch connections of an app:
watch -n 1.0 "netstat -tuwWpn | grep kget"

Find/Replace string in multiple files:
find . -name "*.php" -print | xargs sed -i 's/foo/bar/g'

Sort lines in file by length:
cat convert.sh | awk '{print length, $0}' | sort -nr | awk '{$1=""; print $0 }' > convert2.sh

Convert video to watch on PDA:
mencoder -of lavf -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=384:keyint=250 -oac mp3lame -lameopts mode=3:preset=medium -vf scale=320:240 -o dst.avi src.avi

Watch syslog (or any other file):
tail -f /var/log/syslog

Install Redshift GUI to protect your eyes in the evening!

Немає коментарів:

Дописати коментар