Troca de conhecimentos sobre o uso da linha de comando e referencia direta ao site commandlinefu.com.
dmesg with colored human-readable dates
31 de Julho de 2012, 0:00 - sem comentários ainda$ dmesg -T|sed -e 's|\(^.*'`date +%Y`']\)\(.*\)|\x1b[0;34m\1\x1b[0m - \2|g'
Use sed to color the output of a human-readable dmesg output
by David Winterbottom (codeinthehole.com)
Show permissions of current directory and all directories upwards to /
24 de Julho de 2012, 0:00 - sem comentários ainda$ namei -m $(pwd)
NB not 'namei -m .', as it slices the path you give it.
by David Winterbottom (codeinthehole.com)
Check command history, but print command instead of execute it
11 de Julho de 2012, 0:00 - sem comentários ainda$ !<command>:p
Example : !find:p
Recommended when command run as superuser
by David Winterbottom (codeinthehole.com)
repeat a command every one second
11 de Julho de 2012, 0:00 - sem comentários ainda$ watch -n 1 "do foo"
Short method of "while x=0; do foo ; sleep 1 ; done"
by David Winterbottom (codeinthehole.com)
Use top to monitor only all processes with the same name fragment 'foo'
27 de Junho de 2012, 0:00 - sem comentários ainda$ top -p $(pgrep -d , foo)
top accecpts a comma separated list of PIDs.
by David Winterbottom (codeinthehole.com)
HourGlass
21 de Junho de 2012, 0:00 - sem comentários ainda$ hourglass(){ trap 'tput cnorm' 0 1 2 15 RETURN;local s=$(($SECONDS +$1));(tput civis;while (($SECONDS<$s));do for f in '|' '\' '-' '/';do echo -n "$f";sleep .2s;echo -n $'\b';done;done;);}
Displays an animated hourglass for x amount of seconds
by David Winterbottom (codeinthehole.com)
List all bash shortcuts
28 de Maio de 2012, 0:00 - sem comentários ainda$ bind -P
This command shows the various shortcuts that can be use in bash, including Ctrl+L, Ctrl+R, etc...
You can translate "\C-y" to Ctrl+y, for example.
by David Winterbottom (codeinthehole.com)
convert single digit to double digits
14 de Maio de 2012, 0:00 - sem comentários ainda$ for i in ?.ogg; do mv $i 0$i; done
from
1.ogg
2.ogg
3.ogg
10.ogg
11.ogg
to
01.ogg
02.ogg
03.ogg
10.ogg
11.ogg
by David Winterbottom (codeinthehole.com)
ping as traceroute
19 de Fevereiro de 2012, 0:00 - sem comentários ainda$ for i in {1..30}; do ping -t $i -c 1 google.com; done | grep "Time to live exceeded"
This command uses ping to get the routers' IP addresses to the destination host as traceroute does. If you know what I mean..
by David Winterbottom (codeinthehole.com)
Annotate tail -f with timestamps
18 de Fevereiro de 2012, 0:00 - sem comentários ainda$ tail -f file | while read; do echo "$(date +%T.%N) $REPLY"; done
by David Winterbottom (codeinthehole.com)