Seven Linux commands that are not frequently used but are very powerful

Source: Internet
Author: User

Seven Linux commands that are not frequently used but are very powerful

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.
Sudo !! Command
Running the command without specifying sudo command will give you permission denied error. So, you don't need to rewrite the whole command again just put '!! 'Will grab the last command.

$ apt-get updateE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/E: Could 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 16s (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 command

The below command generates a simple web page over HTTP for the directory structure tree and can be accessed at port 8000 in browser till interrupt signal is sent.

 python -m SimpleHTTPServer

3. ss Command

"Ss" indicates socket statistics. This command investigates the socket and displays information similar to the netstat command. It can display more TCP and status information than other tools.

ss Command

The "ss" stands for socket statistics. The command investigates the socket and shows information similar to netstat command. It can display more TCP and state informations than other tools.

4. last Command <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Examples/zB7s/Uyr61xMrHyc + 0zrXHwrzTw7untcTA + examples/examples + PC9wPg0KPHA + PGNvZGUgY2xhc3M9 "hljs SQL"> The "last" command show the history of last logged in users. this command searches through the file "/var/log/wtmp" and shows a list of logged-in and logged-out users along with tty's.

5. pstree command
This command displays all processes currently running and their associated sub-processes. The output is in a tree format similar to the 'tree' command.
Pstree
This commands shows all the processes running currently along with associated child process, in a tree like format similar to 'tree' command output.


6. tree Command

Get the structure of the current folder in tree format.

tree command

Get the current directory structure in tree like format.

7. 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.

nl Command

The “nl command” number the lines of a file. Number the lines of a file say ‘one.txt‘ with lines say (Fedora, Debian, Arch, Slack and Suse). First list the content of a file “text.txt” using cat command.

 

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.