LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Share Your Top 10 Linux Commands... (https://www.linuxquestions.org/questions/linux-general-1/share-your-top-10-linux-commands-4175470991/)

JLndr 07-26-2013 07:05 AM

Share Your Top 10 Linux Commands...
 
Share your top 10 Linux commands. It's easy to do this from the command line. Just copy and paste this code snippet, and then let us know your results!

Code:

history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
Here is mine (I was a little shocked):
Code:

john@breezy:~$ history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
    1  142  28.4%  sudo
    2  139  27.8%  ls
    3  104  20.8%  clear
    4  30  6%    cd
    5  27  5.4%  htop
    6  18  3.6%  exit
    7  7    1.4%  ftp
    8  4    0.8%  hostname
    9  4    0.8%  git
    10  3    0.6%  history

Enjoy! :)

P.S. I found a similar thread like this from a long time ago, but it was a little different. (http://www.linuxquestions.org/questi...mmands-180329/)

DavidMcCann 07-26-2013 12:19 PM

I get
Code:

1        110  16.0116%  ls
    2        88  12.8093%  cd
    3        85  12.3726%  man
    4        67  9.75255%  rpm
    5        45  6.55022%  md5sum
    6        37  5.38574%  wget
    7        21  3.05677%  openssl
    8        21  3.05677%  gnome-terminal
    9        20  2.91121%  cat
    10        17  2.47453%  su

In other words, I generally use the terminal in user mode only to check the distros I've downloaded for testing. I was a bit puzzled by gnome-terminal and su, then I realised it's recording when I press Super-r and it generates
Code:

gnome-terminal -e "su -"
Now the root terminal is a different business
Code:

1        161  30.9615%  cp
    2        55  10.5769%  yum
    3        55  10.5769%  nano
    4        52  10%        setenforce
    5        47  9.03846%  ls
    6        29  5.57692%  gedit
    7        25  4.80769%  rm
    8        18  3.46154%  nautilus
    9        16  3.07692%  man
    10        10  1.92308%  cd


Janus_Hyperion 07-26-2013 12:56 PM

Interesting! Here is mine.

Code:

$ history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' \\
| grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10

    1        279  27.9%  ls
    2        228  22.8%  cd
    3        58  5.8%  exit
    4        40  4%    rm
    5        31  3.1%  su
    6        25  2.5%  scp
    7        25  2.5%  mv
    8        24  2.4%  ffmpeg
    9        16  1.6%  man
    10        14  1.4%  yum

As for my root terminal,

Code:

# history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' \\
| grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10

    1        258  25.8%  yum
    2        161  16.1%  cd
    3        155  15.5%  ls
    4        83  8.3%  exit
    5        36  3.6%  vim
    6        28  2.8%  systemctl
    7        27  2.7%  rm
    8        21  2.1%  yum-config-manager
    9        16  1.6%  cryptsetup
    10        15  1.5%  lsblk


suicidaleggroll 07-26-2013 01:22 PM

Code:

    1        261  26.1%  cd
    2        253  25.3%  ls
    3        88  8.8%  vi
    4        75  7.5%  idl
    5        41  4.1%  cvs
    6        30  3%    gv
    7        18  1.8%  du
    8        18  1.8%  cat
    9        17  1.7%  rm
    10        17  1.7%  lrt

Looks about right

szboardstretcher 07-26-2013 01:27 PM

Interesting!

My dev box:

Code:

    1  268  26.8%  cd
    2  158  15.8%  svn
    3  155  15.5%  ls
    4  57  5.7%  ip
    5  54  5.4%  rsync
    6  29  2.9%  vim
    7  27  2.7%  tcpdump
    8  23  2.3%  route
    9  21  2.1%  mysql
    10  18  1.8%  perf


DarkShadow 07-26-2013 01:38 PM

As a regular user
Code:

    1  143  30.4904%  cd
    2  59  12.58%    mplayer
    3  51  10.8742%  ffmpeg
    4  17  3.62473%  su
    5  16  3.41151%  ls
    6  11  2.34542%  axel
    7  10  2.1322%    rm
    8  9    1.91898%  xwininfo
    9  8    1.70576%  md5sum
    10  8    1.70576%  cat

As root
Code:

    1  12  26.087%  vi
    2  6  13.0435%  exit
    3  6  13.0435%  cd
    4  3  6.52174%  echo
    5  3  6.52174%  atq
    6  2  4.34783%  gpasswd
    7  2  4.34783%  atrm
    8  2  4.34783%  at
    9  1  2.17391%  svn
    10  1  2.17391%  shutdown


Habitual 07-26-2013 04:01 PM

Code:

bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

in .bashrc for bash history completion.

Indispensable for sysadmins.

frankbell 07-26-2013 07:28 PM

As user, I get

Code:

    1        191  38.2%  ping  <----My ISP had some problems last week.
    2        97  19.4%  ls
    3        36  7.2%  cd
    4        21  4.2%  rm
    5        18  3.6%  for
    6        17  3.4%  conky
    7        15  3%    traceroute
    8        14  2.8%  exit
    9        11  2.2%  cat
    10        9    1.8%  par2repair

As root, I get

Code:

1        79  15.8%  ls
    2        56  11.2%  exit
    3        46  9.2%  sh
    4        45  9%    cd
    5        19  3.8%  reboot  <---I usually reboot from the terminal
    6        16  3.2%  ps
    7        12  2.4%  ping
    8        12  2.4%  cat
    9        12  2.4%  avgctl
    10        11  2.2%  pkgtool

H/T to DarkShadow for suggesting checking both.

fogpipe 07-26-2013 08:54 PM

Hey :) interesting thread, seeing what others use.

Heres mine:
Quote:

1 62 12.4% su
2 40 8% more
3 34 6.8% ssh
4 28 5.6% SDLvncviewer
5 27 5.4% vi
6 26 5.2% ls
7 21 4.2% cd
8 17 3.4% locate
9 16 3.2% df
10 14 2.8% nvidia-settings
nvidia-settings is in there because the last few weeks i have been using the vid card to do setiathome work units and im keeping an eye on its temperature.

On another machine that im logged into mostly as root through a terminal:
Quote:

1 71 20.4611% vi
2 35 10.0865% ls
3 29 8.35735% cd
4 21 6.05187% netstat
5 18 5.18732% .
6 13 3.7464% init
7 9 2.59366% more
8 8 2.30548% ps
9 7 2.01729% locate
10 6 1.72911% runlevel

Im suprised that "." made the list.

Randicus Draco Albus 07-26-2013 09:52 PM

Quote:

Originally Posted by JLndr (Post 4997156)
Here is mine (I was a little shocked):
[code] 1 142 28.4% sudo

I too am shocked. You use Debian, but your most used command is sudo?:scratch:

kooru 07-27-2013 02:58 AM

Nice thread :)

Normal user

Code:

    1        125  25%  ls
    2        49  9.8%  rm
    3        49  9.8%  dig
    4        40  8%    ftp
    5        37  7.4%  unrar
    6        30  6%    cd
    7        22  4.4%  su
    8        20  4%    ping
    9        18  3.6%  vi
    10        10  2%    man

root

Code:

    1        178  35.6713%  ls
    2        113  22.6453%  cd
    3        54  10.8216%  vi
    4        30  6.01202%  rsync
    5        22  4.40882%  rm
    6        11  2.20441%  exit
    7        8    1.60321%  ping
    8        8    1.60321%  iptables
    9        7    1.40281%  mount
    10        5    1.002%    umount


dereism 07-28-2013 11:45 AM

What a nifty idea for a thread. I found it interesting to look over my own usage as well as others'.

$:
Code:


    1        71  20.0565%  cd
    2        29  8.19209%  ls
    3        28  7.9096%    su
    4        22  6.21469%  wmctrl
    5        21  5.9322%    ffmpeg
    6        19  5.36723%  python3
    7        17  4.80226%  sh
    8        15  4.23729%  xdotool
    9        14  3.9548%    wget
    10        9  2.54237%  mkdir

#:
Code:


    1        201  23.3721%  yum
    2        187  21.7442%  cd
    3        77  8.95349%  ls
    4        41  4.76744%  systemctl
    5        35  4.06977%  umask
    6        31  3.60465%  scribes
    7        26  3.02326%  reboot
    8        26  3.02326%  make
    9        17  1.97674%  rm
    10        14  1.62791%  hg


Z038 07-28-2013 12:29 PM

$:

Code:

    1  102  20.4%  ls
    2  74  14.8%  cd
    3  52  10.4%  nano
    4  23  4.6%  man
    5  23  4.6%  cat
    6  21  4.2%  exit
    7  19  3.8%  rm
    8  14  2.8%  mv
    9  12  2.4%  less
    10  9    1.8%  su

#:

Code:

    1  112  22.4%  ls
    2  78  15.6%  cat
    3  60  12%    cd
    4  30  6%    echo
    5  27  5.4%  man
    6  24  4.8%  less
    7  20  4%    mail
    8  13  2.6%  dig
    9  9    1.8%  chmod
    10  7    1.4%  which


I have export HISTTIMEFORMAT="%y/%m/%d %T " set in my regular user .bashrc, so I had to change the awk command from CMD($2) to CMD($4).

kedarp 07-28-2013 12:45 PM

Here are mine.
Code:

1  110  13.269%    ping
2  69  8.32328%  clear
3  66  7.9614%    cd
4  62  7.47889%  su
5  49  5.91074%  ls
6  42  5.06634%  service
7  40  4.82509%  mysql
8  37  4.46321%  man
9  36  4.34258%  dstat
10  17  2.05066%  reboot


timl 07-28-2013 06:33 PM

Quote:

1 156 15.6% ls
2 136 13.6% ssh
3 66 6.6% catmes ----> sudo cat /var/log/messages
4 63 6.3% sudo
5 57 5.7% catyum ----> sudo cat /var/log/yum.log
6 52 5.2% xferpi ----> copy file to pi
7 52 5.2% rmtor ----> remove torrent file
8 47 4.7% ll
9 40 4% cat
10 34 3.4% mv
I use a few aliases


All times are GMT -5. The time now is 10:46 PM.