Pages

Tuesday, December 24, 2019

How to Find Top 10 Most Used Commands On Linux

 If you enter this command in the command line it will show you an ordered list of the commands you use most, with the number of times each one was used
history shows a list of all the commands we have executed recently (used by bash and other shells to display the previous and subsequent commands by pressing the up and down arrow keys, when using !! to execute the previous command, etc.) being those with the smallest numbers the oldest. Awk is used to keep the command itself, without arguments or flags. Use sort to sort the command list alphabetically. Then uniq, that given a list in which we have n successive identical lines leaves only one of the lines, adding the number of equal lines that were before (flag -c) at the beginning of the line. The list is reordered so that the sorting is by the number of times the command was executed, which is now the first string in the line (-n to be numerical sorting), and from highest to lowest (-r , reversed). Finally, head is used to display the first 10 (-10) lines.
200 sudo
100 pngquant
82 cd
33 aptitude
21 javac
19 ssh
15 exit
14  man
12  javac
4 python

 You will probably get smaller numbers because, by default, bash only saves the last 500. To save 1000, we would modify the .bashrc by setting the HISTSIZE variable to 1000:

echo «export HISTSIZE = 1000» >> ~ / .bashrc

If those are the linux commands you use most, you may be interested in the following page CommandlineFu is a website where users can send their favorite Linux commands, add comments, and vote on commands sent by other users; An essential resource if you want to become true experts in the use of the console.
From this page, for me these were the 10 most important commands for the linux terminal
sudo !!

Execute the last command entered as root.

python -m SimpleHTTPServer

Start a web server that serves the files in the current directory at http: // localhost: 8000

^ foo ^ bar

Execute the last command, replacing the text "foo" with "bar"
Ctrl + X, CtrlE 

It invokes a text editor in which to write the command that we are going to execute. The command will be executed once the editor is closed
alt+. 
 Insert the last argument used at the point where the cursor is located

reset

Reset the console

mount | column -t

Show current mount points with a friendly reading format

echo «ls -l» | at midnight

Execute a command at the indicated time

curl ip.appspot.com

Download the document from http://ip.appspot.com to show the external IP of the device

man ascii

Display the help page with the ASCII character table

No comments:

Post a Comment