11 Linux commands that few people know but are useful

Source: Internet
Author: User
Keywords nbsp very very useful little man this

The

Linux command line attracts most Linux enthusiasts. A normal Linux user typically has about 50-60 commands to handle daily tasks. Linux commands and their transformations are the most valuable treasures for Linux users, Shell scripting programmers, and administrators. Few Linux commands are known, but they are handy and useful, whether you're a novice or an advanced user.
Less-known Linux commands
The purpose of this article is to introduce some of the less-known Linux commands that will effectively help you manage your desktop/server.
1 sudo!! The command
runs without a specific input sudo command, giving an error without permissions. Well, you don't need to rewrite the entire command, just type '!! ' You can grab the last command.
$ apt Update
e:could not open lock File/var/lib/apt/lists/lock-open (13:permission denied)
E:unable to Loc K 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 for you root?
$ sudo!!
sudo apt update
[sudo] password for server:
...
..
fetched 474 KB in 16s (28.0 KB)
Reading package lists ... Done
server@localhost:~$
2. Python command
The following command produces a simple Web page that displays a folder structure tree via HTTP, which can be http://www.aliyun.com/on the port via the browser Zixun/aggregation/37392.html ">8000 access until the interrupt signal is issued.
# python-m Simplehttpserver


3. MTR command
Most of us are familiar with Ping and traceroute. What about the MTR command to bring the two-order function into one? If MTR is not installed on your machine, apt or yum need the package.
$ sudo apt install mtr (on Debian based BAE)
# yum Install MTR (on Red Hat based BAE)
Now run the MTR command to start viewing MTR running hosts and google.com direct network connections.
# mtr google.com




mtr Command


4. Ctrl+x+e Command


This command is useful for administrators and developers. To automate daily tasks, administrators need to open the editor by entering VI, VIM, nano, and so on.


can start working in the editor by simply Tapping "ctrl-x-e" from the command line.


5. NL command


the number of rows to add a file to the NL command. A file called ' One.txt ' whose contents are (Fedora, Debian, Arch, Slack, and SuSE), adding line numbers to each line. First, use the Cat command to display the contents of the "One.txt" file.


# cat One.txt


Fedora


Debian


Arch


Slack


SuSE


now runs the NL command, which is displayed by adding line numbers.


# NL One.txt


1 Fedora


2 Debian


3 Arch


4 Slack


5 SuSE


6. Shuf command


The "SHUF" command randomly selects rows/files/folders from a file or folder. First, use the LS command to display the contents of the folder.


# ls


Desktop Documents Downloads Music Pictures public Templates videos


# ls | Shuf (Shuffle Input)


Music


Documents


Templates


Pictures


Public


Desktop


Downloads


Videos


# ls | SHUF-N1 (pick on random selection)


Public


# ls | Shuf-n1


Videos


# ls | Shuf-n1


Templates


# ls | Shuf-n1


Downloads


Note: You can replace ' N1 ' with ' N2 ' to output two random selections or use N3, N4, and other digital outputs for any random selection.


7. SS Command


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


# SS


State recv-q Send-q Local address:port Peer address:port


estab 0 0 192.168.1.198:41250 *.*.*.*:http


close-wait 1 0 127.0.0.1:8000 127.0.0.1:41393


estab 0 0 192.168.1.198:36239 *.*.*.*:http


estab 310 0 127.0.0.1:8000 127.0.0.1:41384


estab 0 0 192.168.1.198:41002 *.*.*.*:http


Estab 0 0 127.0.0.1:41384 127.0.0.1:8000


8. Last Command

The
"Last" command displays historical information about the user who logged on to it. This command displays a list of users of Logged-in and Logged-out and their TTY ' s by searching for the file "/var/log/wtmp".


# Last


Server pts/0:0 Tue Oct 12:03 e.g. logged in


Server tty8:0 Tue Oct 12:02 e.g. logged in


  ...


  ...


(Unknown tty8:0 Tue Oct 22 12:02-12:02 (00:00)


Server pts/0:0 Tue Oct 22 10:33-12:02 (01:29)


Server tty7:0 Tue Oct 22 10:05-12:02 (01:56)


(Unknown tty7:0 Tue Oct 22 10:04-10:05 (00:00)


reboot system boot 3.2.0-4-686-pae Tue Oct 22 10:04-12:44 (02:39)


Wtmp begins Fri Oct 4 14:43:17 2007


9. Curl Ifconfig.me


How do you get your external IP address? Using Google? Then this command will output your external IP address at your terminal.


# Curl Ifconfig.me


Note: You may not follow the curl package, you need Apt/yum to follow the package.


10. Tree command


the structure of the current folder in a tree format.


# Tree


  .


|-| Desktop


|-| Documents


| '--37.odt


|-| Downloads


| |--Attachments.zip


| |--Ttf-indic-fonts_0.5.11_all.deb


| |--Ttf-indic-fonts_1.1_all.deb


| '--wheezy-nv-install.sh


|---Music


|-| Pictures


| |--Screenshot from 2013-10-22 12:03:49.png


| '--Screenshot from 2013-10-22 12:12:38.png


| |-Public


|-|-Templates


'--Videos


directories,


11. Pstree


This command displays all currently running processes and their associated subprocess, outputting a tree-like format similar to the ' Trees ' command.


# Pstree


Init─┬─networkmanager───{networkmanager}


├─accounts-daemon───{accounts-daemon}


├─acpi_fakekeyd


├─acpid


├─apache2───10*[apache2]


├─at-spi-bus-laun───2*[{at-spi-bus-laun}]


├─atd


├─avahi-daemon───avahi-daemon


├─bluetoothd


├─colord───{colord}


├─colord-sane───2*[{colord-sane}]


├─console-kit-dae───64*[{console-kit-dae}]


├─cron


├─cupsd


├─2*[dbus-daemon]


├─dbus-launch


├─dconf-service───2*[{dconf-service}]


├─dovecot─┬─anvil


│├─config


│└─log


├─exim4


├─gconfd-2


├─gdm3─┬─gdm-simple-slav─┬─xorg


││├─gdm-session-wor─┬─x-session-manag─┬─evolution-a+


││││├─gdu-notific+


││││├─gnome-scree+


││││├─gnome-setti+


││││├─gnome-shell+++


││││├─nm-applet──+++


││││├─ssh-agent


││││├─tracker-min+


││││├─tracker-sto+


││││└─3*[{x-sessi+


│││└─2*[{GDM-SESSION-WOR}]


││└─{gdm-simple-slav}


│└─{gdm3}


├─6*[getty]


├─gnome-keyring-d───9*[{gnome-keyring-d}]


├─gnome-shell-cal───2*[{gnome-shell-cal}]


├─goa-daemon───{goa-daemon}


├─gsd-printer───{gsd-printer}


├─gvfs-afc-volume───{gvfs-afc-volume}


so far so much. In the next article, I'll cover some interesting linux commands that few other people know about. Connect Tecmint to stay tuned by then. Love and sharing will help us spread.

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.