Ir para o conteúdo
ou

Software livre Brasil

Tela cheia Sugerir um artigo
 Feed RSS

CommandLineFu

4 de Junho de 2009, 0:00 , por Software Livre Brasil - | Ninguém está seguindo este artigo ainda.

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, por Software Livre Brasil - 0sem 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.

Submitted by Schneckentreiber

Options:

commandlinefu.com by David Winterbottom



Search for commands from the command line

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ clfu-seach

Search at CommandLineFu.com from your terminal.

Get the clfu-seach at http://www.colivre.coop.br/Aurium/CLFUSearch

Submitted by aurium

Options:

commandlinefu.com by David Winterbottom



Add timestamp to history

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem 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

Submitted by fritz_monroe

Options:

commandlinefu.com by David Winterbottom



wrap long lines of a text

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem 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

Submitted by vincentp

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, por Software Livre Brasil - 0sem 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

Submitted by bunedoggle

Options:

commandlinefu.com by David Winterbottom



Add Password Protection to a file your editing in vim.

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem 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

Submitted by denzuko

Options:

commandlinefu.com by David Winterbottom



Make anything more awesome

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ command | figlet

Pipe any command through figlet to make the output more awesome. Example:

ls | figlet
Submitted by isaacs

Options:

commandlinefu.com by David Winterbottom



Quickly graph a list of numbers

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem 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.

Submitted by penthief

Options:

commandlinefu.com by David Winterbottom



Display current bandwidth statistics

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem 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

Submitted by vgagliardi

Options:

commandlinefu.com by David Winterbottom



Tags deste artigo: cli commandline unix terminal