Troca de conhecimentos sobre o uso da linha de comando e referencia direta ao site commandlinefu.com.
Manually Pause/Unpause Firefox Process with POSIX-Signals
4 de Junho de 2009, 0:00 - sem comentários ainda$ killall -STOP -m firefox
Continue with:
killall -CONT -m firefox
Suspends all Firefox Threads. Results in Zero CPU load.
Useful when having 100+ Tabs open and you temporarily need the power elsewhere.
Be careful - might produce RACE CONDITIONS or LOCKUPS in other processes or FF itself.
matching is case sensitive.
Options:
commandlinefu.com by David Winterbottom
Search for commands from the command line
4 de Junho de 2009, 0:00 - sem comentários ainda$ clfu-seach
Search at CommandLineFu.com from your terminal.
Get the clfu-seach at http://www.colivre.coop.br/Aurium/CLFUSearch
Options:
commandlinefu.com by David Winterbottom
Add timestamp to history
4 de Junho de 2009, 0:00 - sem comentários ainda$ export HISTTIMEFORMAT="%F %T "
History usually only gives the command number and the command. This will add a timestamp to the history file.
Note: this will only put the correct timestamp on commands used after the export is done. You may want to put this in your .bashrc
Options:
commandlinefu.com by David Winterbottom
wrap long lines of a text
4 de Junho de 2009, 0:00 - sem comentários ainda$ fold -s -w 90 file.txt
wraps text lines at the specified width (90 here).
-s option is to force to wrap on blank characters
-b count bytes instead of columns
Options:
commandlinefu.com by David Winterbottom
Search recursively to find a word or phrase in certain file types, such as C code
4 de Junho de 2009, 0:00 - sem comentários ainda$ find . -name "*.[ch]" -exec grep -i -H "search pharse" {} \;
I have a bash alias for this command line and find it useful for searching C code for error messages.
The -H tells grep to print the filename. you can omit the -i to match the case exactly or keep the -i for case-insensitive matching.
This find command find all .c and .h files
Options:
commandlinefu.com by David Winterbottom
Add Password Protection to a file your editing in vim.
4 de Junho de 2009, 0:00 - sem comentários ainda$ vim -x
While I love gpg and truecrypt there's some times when you just want to edit a file and not worry about keys or having to deal needing extra software on hand. Thus, you can use vim's encrypted file format.
For more info on vim's encrypted files visit: http://www.vim.org/htmldoc/editing.html#encryption
Options:
commandlinefu.com by David Winterbottom
Make anything more awesome
4 de Junho de 2009, 0:00 - sem comentários ainda$ command | figlet
Pipe any command through figlet to make the output more awesome. Example:
ls | figlet
Options:
commandlinefu.com by David Winterbottom
Quickly graph a list of numbers
4 de Junho de 2009, 0:00 - sem comentários ainda$ gnuplot -persist <(echo "plot '<(sort -n listOfNumbers.txt)' with lines")
Useful when you've produced a large file of numbers, and want to quickly see the distribution. The value of y halfway along the x axis is the median. Simple!
Just create the listOfNumbers.txt file with a number on each line to try it out.
Options:
commandlinefu.com by David Winterbottom
Display current bandwidth statistics
4 de Junho de 2009, 0:00 - sem comentários ainda$ ifstat -nt
ifstat, part of ifstat package, is a tool for displaying bandwidth and other statistics. The -n option avoid to display header periodically, the -t option put a timestamp at the beginning of the line.
Works for me on Debian and CentOS
Options:
commandlinefu.com by David Winterbottom