Linux Command lines attract most Linux enthusiasts. A normal Linux User generally has about 50-60 commands to process daily tasks. Linux commands and their conversion are the most valuable treasures for Linux users, Shell script programmers, and administrators. Some Linux commands are rarely known, but they are very convenient and useful whether you are a beginner or an advanced user.
Linux commands that few people know
The purpose of this article is to introduce some Linux commands that are rarely known. They will help you efficiently manage your desktop/server.
1. sudo !! Command
If you run the command without a specific sudo command, an error is returned. Then, you don't need to rewrite the entire command, just enter '!! 'To capture the final command.
$ Apt-get update
E: cocould not open lock file/var/lib/apt/lists/lock-open (13: Permission denied)
E: Unable to lock directory/var/lib/apt/lists/
E: cocould not open lock file/var/lib/dpkg/lock-open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
$ Sudo !!
Sudo apt-get update
[Sudo] password for server:
...
..
Fetched 474 kB in 16 s (28.0 kB/s)
Reading package lists... Done
Server @ localhost :~ $
2. python commands
The following command produces a simple webpage that displays the folder structure tree through HTTP. It can be accessed through a browser on port 8000 until an interruption signal is sent.
# Python-m SimpleHTTPServer
3. mtr command
Most of us are familiar with ping and traceroute. The mtr command combines the functions of the two commands. If mtr is not installed on your machine, the packages required by apt or yum.
$ Sudo apt-get install mtr (On Debian based Systems)
# Yum install mtr (On Red Hat based Systems)
Now run the mtr command to check the direct network connection between the host running the mtr and google.com.
# Mtr google.com
Mtr command
4. Ctrl + x + e command
This command is very useful for administrators and developers. To automate daily tasks, the administrator needs to open the editor by entering vi, vim, nano, and so on.
Just press Ctrl-x-e from the command line to start working in the editor.
5. nl command
"Nl command" to add the number of lines to the file. A file named 'one.txt '. The content of each line is (Fedora, Debian, Arch, Slack, and SUSE), and the row number is added to each line. First, use the catcommand to display the file content of mongoone.txt.
# Cat one.txt
Fedora
Debian
Arch
Slack
Suse
Run the "nl command" to display it by adding a row number.
# Nl one.txt
1 fedora
2 debian
3 arch
4 slack
5 suse
Recommended reading:
Linux Command cd
Cat for Linux commands
Linux Command alias/unalias
Linux Command Parsing: su root and su-root
Interactive input of Linux commands read
File Processing commands for Linux commands