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.


Monitor bandwidth by pid

24 de Outubro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ nethogs -p eth0

Nethogs is a useful tool for monitor bandwidth consumption by pid. Tested on Debian an CentOs

commandlinefu.com

by David Winterbottom (codeinthehole.com)



To print a specific line from a file

15 de Outubro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ sed -n 5p <file>

You can get one specific line during any procedure. Very interesting to be used when you know what line you want.

commandlinefu.com

by David Winterbottom (codeinthehole.com)



List only the directories

8 de Outubro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ ls -d */

-d: list directory entries instead of contents, and do not dereference symbolic links

commandlinefu.com

by David Winterbottom (codeinthehole.com)



backup all your commandlinefu.com favourites to a plaintext file

30 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ clfavs(){ URL="http://www.commandlinefu.com";wget -O - --save-cookies c --post-data "username=$1&password=$2&submit=Let+me+in" $URL/users/signin;for i in `seq 0 25 $3`;do wget -O - --load-cookies c $URL/commands/favourites/plaintext/$i >>$4;done;rm -f c;}

Usage: clfavs username password num_favourite_commands file_in_which_to_backup

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Clean up poorly named TV shows.

29 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ rename -v 's/.*[s,S](\d{2}).*[e,E](\d{2}).*\.avi/'SHOW NAME'\ S$1E$2.avi/' poorly.named.file.s01e01.avi

Replace 'SHOW NAME' with the name of the TV show.

Add -n to test the command without renaming files.

Check the 'sample output'.

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Change user, assume environment, stay in current dir

28 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ su -- user

I've used this a number of times troubleshooting user permissions. Instead of just 'su - user' you can throw another hyphen and stay in the original directory.

commandlinefu.com

by David Winterbottom (codeinthehole.com)



List Network Tools in Linux

25 de Setembro de 2009, 0:00, por Software Livre Brasil - 1Um comentário$ apropos network |more

Get all the networking related commands for your distro

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Remove blank lines from a file using grep and save output to new file

25 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ grep . filename > newfilename

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Save current layout of top

23 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ <Shift + W>

'top' has fancy layout modes where you can have several windows with different things displayed. You can configure a layout and then save it with 'W'. It will then restored every time you run top.

E.g. to have to colored windows, one sorted by CPU usage, the other by memory usage, run top

top

then press the keys

<A> <z> <a> <-> <a> <z> <a> <-> <a>

and then as you don?t want to repeat this the next time:

<W>

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Execute a command with a timeout

23 de Setembro de 2009, 0:00, por Software Livre Brasil - 0sem comentários ainda$ timeout 10 sleep 11

commandlinefu.com

by David Winterbottom (codeinthehole.com)



Tags deste artigo: cli commandline unix terminal