11 Linux commands that are rarely known but useful

Source: Internet
Author: User
Tags ping and traceroute

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

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.