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.


Cleanup firefox's database.

5 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ pgrep -u `id -u` firefox-bin || find ~/.mozilla/firefox '*.sqlite'|(while read -e f; do echo 'vacuum;'|sqlite "$f" ; done)

Sqlite database keeps collecting cruft as time passes, which can be cleaned by the 'vacuum;' command. This command cleans up the cruft in all sqlite files relating to the user you have logged in as. This command has to be run when firefox is not running, or it will exit displaying the pid of the firefox running.

commandlinefu.com

by David Winterbottom (codeinthehole.com)



use vim to get colorful diff output

4 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ svn diff | view -

:q to quit

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Find files that were modified by a given command

4 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/file

This has helped me numerous times trying to find either log files or tmp files that get created after execution of a command. And really eye opening as to how active a given process really is. Play around with -anewer, -cnewer & -newerXY

commandlinefu.com

by David Winterbottom (codeinthehole.com)



directly ssh to host B that is only accessible through host A

31 de Agosto de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ ssh -t hostA ssh hostB

Of course you need to be able to access host A for this ;-)

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Terminal - Show directories in the PATH, one per line with sed and bash3.X `here string'

31 de Agosto de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ tr : '\n' <<<$PATH

commandlinefu.com

by David Winterbottom (codeinthehole.com)



get all pdf and zips from a website using wget

30 de Agosto de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ wget --reject html,htm --accept pdf,zip -rl1 url

If the site uses https, use:

wget --reject html,htm --accept pdf,zip -rl1 --no-check-certificate https-url

commandlinefu.com

by David Winterbottom (codeinthehole.com)



How fast is the connexion to a URL, some stats from curl

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

commandlinefu.com

by David Winterbottom (codeinthehole.com)



convert unixtime to human-readable

28 de Agosto de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ date -d @1234567890

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Show directories in the PATH, one per line

26 de Agosto de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ echo ${PATH//:/$'\n'}

Shorter version.

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Search commandlinefu.com from the command line using the API

23 de Agosto de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }

Usage: cmdfu hello world

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Tags deste artigo: cli commandline unix terminal