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.


Show git branches by date - useful for showing active branches

8 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ 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

Print out list of all branches with last commit date to the branch, including relative time since commit and color coding.

Submitted by brunost

Options:

commandlinefu.com by David Winterbottom



Create a nifty overview of the hardware in your computer

7 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ lshw -html > hardware.html

After the command is done, open the html file in a browser

Submitted by flart

Options:

commandlinefu.com by David Winterbottom



Find if the command has an alias

7 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ type -all command
Submitted by marssi

Options:

commandlinefu.com by David Winterbottom



coloured tail

5 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ tail -f FILE | perl -pe 's/KEYWORD/\e[1;31;43m$&\e[0m/g'

tail with coloured output with the help of perl - need more colours? here is a colour table:

http://www.tuxify.de/?p=23

Submitted by tuxifier

Options:

commandlinefu.com by David Winterbottom



Shutdown a Windows machine from Linux

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ net rpc shutdown -I ipAddressOfWindowsPC -U username%password

This will issue a shutdown command to the Windows machine. username must be an administrator on the Windows machine. Requires samba-common package installed. Other relevant commands are:

net rpc shutdown -r : reboot the Windows machine

net rpc abortshutdown : abort shutdown of the Windows machine

Type:

net rpc

to show all relevant commands

Submitted by LrdShaper

Options:

commandlinefu.com by David Winterbottom



create an emergency swapfile when the existing swap space is getting tight

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000;sudo mkswap /swapfile; sudo swapon /swapfile

Create a temporary file that acts as swap space. In this example it's a 1GB file at the root of the file system. This additional capacity is added to the existing swap space.

Submitted by dcabanis

Options:

commandlinefu.com by David Winterbottom



Relocate a file or directory, but keep it accessible on the old location throug a simlink.

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ mv $1 $2 && ln -s $2/$(basename $1) $(dirname $1)

Used for moving stuff around on a fileserver

Submitted by svg

Options:

commandlinefu.com by David Winterbottom



Compare two directory trees.

4 de Junho de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ diff <(cd dir1 && find | sort) <(cd dir2 && find | sort)

This uses Bash's "process substitution" feature to compare (using diff) the output of two different process pipelines.

Submitted by mbirk

Options:

commandlinefu.com by David Winterbottom



Share a 'screen'-session

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

Ater person A starts his screen-session with `screen`, person B can attach to the srceen of person A with `screen -x`. Good to know, if you need or give support from/to others.

Submitted by GeckoDH

Options:

commandlinefu.com by David Winterbottom



Find last reboot time

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

Displays time of last system boot

Submitted by sharfah

Options:

commandlinefu.com by David Winterbottom



Tags deste artigo: cli commandline unix terminal