itnet7
Mission Specialist
Mission Specialist
  • 2,193 Views

Re: What's your favorite tool/cmd in Linux?

There are Sooooooo many good tool/cmd(s) in Linux it would be hard to say exactly which are my favorites. I often use the following:

mlocate - updatedb; locate <anything> It's important to note your results are only good as your last updatedb command :-)

byobu - tmux/screen wrapper that shows an informational Banner at the bottom

irssi for IRC

yum info/list/whatprovides */<filename>

pvs, vgs, lvs

tar pipes

rsync

scp

sftp

 

 

Reply
Loading...
Aloysius
Cadet
Cadet
  • 2,192 Views

Re: What's your favorite tool/cmd in Linux?

I do a lot of network traffic analysis, so pcap, nmap, mtr, nmon all find weekly use.

Reply
Loading...
darthsmall
Cadet
Cadet
  • 2,183 Views

Re: What's your favorite tool/cmd in Linux?

The for loop is the beginning of all automation.  Tie it to a list or to another command that supplies a list, add in ssh keys, and yehaaa, you are on your way.

for i in `cat $mylist`

do

      #amazing things

done

 

  

0 Kudos
Reply
Loading...
sbulav
Flight Engineer Flight Engineer
Flight Engineer
  • 2,166 Views

Re: What's your favorite tool/cmd in Linux?

I'm writing a lot of complicated commands, so I'm following little tricks a lot:

ctrl+x,e - Edit current command in your $EDITOR

fc - Edit last command(from history) in your $EDITOR

 

Reply
Loading...
Ap023
Cadet
Cadet
  • 2,160 Views

Re: What's your favorite tool/cmd in Linux?

my history say ls -ltrh


ap8
0 Kudos
Reply
Loading...
Rajpol
Cadet
Cadet
  • 2,150 Views

Re: What's your favorite tool/cmd in Linux?

ps aux --sort -rss 
Above command helps to find out the process which are consuming high memory.

Reply
Loading...
jfern
Cadet
Cadet
  • 2,070 Views

Re: What's your favorite tool/cmd in Linux?

I don't link I have a-1, but if I were to choose, the combination of | PIPE, grep, and cut are so beautiful.

0 Kudos
Reply
Loading...
marco_ab
Cadet
Cadet
  • 2,059 Views

Re: What's your favorite tool/cmd in Linux?

I do use several commands daily, but I can't live without :  grep, sed, cut or awk  really usefull.

For other tools/commands I shoud say:  sar, ss, df, du, top, kill, ps axf, vi, sudo ...  etc almost all haha

Reply
Loading...
Florian
Moderator
Moderator
  • 2,057 Views

Re: What's your favorite tool/cmd in Linux?

A little find exercise.

  1. Create 10000 files in a sub directory called example
    Spoiler
    $ mkdir example ; cd example
    $ for i in $(seq 1 10000); do touch file-$i ; done
  2. Delete them using find -exec. Use the time command to see how long it takes.
    Spoiler
    $time find . -exec rm {}
    real	0m6.288s
    user	0m3.530s
    sys	0m2.736s

     

  3. Now try again using -delete
    Spoiler
    $ time find * -delete 
    real	0m0.186s
    user	0m0.037s
    sys	0m0.149s
    Much faster, isn't it?
  4. How about changing permissions? Create 10000 files and remove the read permission for other on each.
    Spoiler
    $ for i in $(seq 1 10000) ; do touch file-$i ; done
    $ find . -exec chmod o-r {} \;
  5. As mentioned in another post, delete speeds things up, because it doesn't call external commands. Instead of a calling external commands one at a time with -exec, you can use a tool called xargs to do this less often. 
    Spoiler
    $ find . | xargs chmod o-r
  6. There is a catch, filenames could contain spaces, so a simple find | xargs might not work.
    Have a look at -0 option in xarg's man page and try again.
    Spoiler
    $ for i in $(seq 1 10000); do touch file\ $i ; done
    $ find | xargs chmod o-r 
    ..
    chmod: cannot access '10000': No such file or directory
    $find -print0 | xargs -0 chmod o-r
Tags (1)
Reply
Loading...
Radesh
Flight Engineer Flight Engineer
Flight Engineer
  • 1,834 Views

Re: What's your favorite tool/cmd in Linux?

I gave some kudos to @flozano .

In the same vein... ansible-doc.

Since I've taken to doing a bunch with Ansible, I find the documentation to be indispensible.

Other than 'help' commands, I love awk. I use it for most operations where I would otherwise use grep, because I usually want to find some pattern, and report on a portion of it. I find that awk makes doing so pretty easy.

 

Reply
Loading...
Join the discussion
You must log in to join this conversation.