After the first four articles in the "Ten Linux commands rarely known" series are highly appreciated, we will present the last article in this series to readers, although it is the last one, but its importance is no less than the previous articles.
Ten Linux commands that are rarely known-Part 2
Ten Linux commands that are rarely known-Part 3
Dozens of Linux commands rarely known-Part 4
11 Linux commands that are rarely known but useful
Linux Command cd
Cat for Linux commands
Linux Command alias/unalias
Linux Command Parsing: su root and su-root
42. lsb_release
The 'lsb _ release' command prints information about the special release. If lsb_release has not been installed, you can use the apt command to install lsb_release in the Debain-based release and yum to install the SDK in the Red Hat-based system.
# lsb_release -aLSB Version: :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:Distributor ID: CentOSDescription: CentOS release 6.3 (Final)Release: 6.3Codename: Final
Note: The '-a' option displays all available information about the version, ID, details, Release number, and R & D code.
43. nc-zv localhost 80
Check whether port 80 is enabled. We can replace '80' with any other port number to check whether the port is enabled or disabled.
$ nc -zv localhost 80Connection to localhost 80 port [tcp/http] succeeded!
Note: Port 80 is enabled .)
Check whether port 8080 is enabled
$ nc -zv localhost 8080nc: connect to localhost port 8080 (tcp) failed: Connection refused
(Note: port 8080 is not enabled .)
44. curl ipinfo. io
This command outputs and provides the 'geographic location' of the IP address '.
$ curl ipinfo.io
"Ip": "xx. xx. xx. xx "," hostname ":" triband-del-aa.bbb.cc.ddd.bol.net.in "," city ":" null "," region ":" null "," country ":" IN "," loc ": "20,77", "org": "AS17813 Mahanagar Telephone Nigam Ltd ".
45. find.-user root
This command outputs the Files Owned by the (root) user in the current directory ). The following lists all Files Owned by 'root' users in the current directory.
# find . -user root./.recently-used.xbel./.mysql_history./.aptitude./.aptitude/config./.aptitude/cache./.bluefish./.bluefish/session-2.0./.bluefish/autosave./.bash_history
List all Files Owned by 'av' users in the current path
# find . -user avi./.cache/chromium/Cache/f_002b66./.cache/chromium/Cache/f_001719./.cache/chromium/Cache/f_001262./.cache/chromium/Cache/f_000544./.cache/chromium/Cache/f_002e40./.cache/chromium/Cache/f_00119a./.cache/chromium/Cache/f_0014fc./.cache/chromium/Cache/f_001b52./.cache/chromium/Cache/f_00198d./.cache/chromium/Cache/f_003680
46. sudo apt-get build-dep ffmpeg
This command automatically creates a dependency when the corresponding package is installed. Therefore, the package installation process is smooth and easy.
# apt-get build-dep ffmpeglibxinerama-dev libxml-namespacesupport-perl libxml-sax-expat-perllibxml-sax-perl libxml-simple-perl libxrandr-dev libxrender-devx11proto-render-dev x11proto-xinerama-dev xulrunner-devThe following packages will be upgraded:libpixman-1-01 upgraded, 143 newly installed, 0 to remove and 6 not upgraded.Need to get 205 MB of archives.After this operation, 448 MB of additional disk space will be used.Do you want to continue [Y/n]?
47. lsof-iTCP: 80-sTCP: LISTEN
This command outputs The Name Of The process/service that is using port 80. Running the following command on port 80 makes it easier to understand this command. It lists the processes/services running on this port.
root@localhost:/home/avi# lsof -iTCP:80 -sTCP:LISTENCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEapache2 1566 root 5u IPv6 5805 0t0 TCP *:www (LISTEN)apache2 1664 www-data 5u IPv6 5805 0t0 TCP *:www (LISTEN)apache2 1665 www-data 5u IPv6 5805 0t0 TCP *:www (LISTEN)apache2 1666 www-data 5u IPv6 5805 0t0 TCP *:www (LISTEN)apache2 1667 www-data 5u IPv6 5805 0t0 TCP *:www (LISTEN)apache2 1668 www-data 5u IPv6 5805 0t0 TCP *:www (LISTEN)
Similarly, you can check the processes/services running on port 22.
root@localhost:/home/avi# lsof -iTCP:22 -sTCP:LISTENCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEsshd 2261 root 3u IPv4 8366 0t0 TCP *:ssh (LISTEN)sshd 2261 root 4u IPv6 8369 0t0 TCP *:ssh (LISTEN)
48. find-size + 100 M
This find command will list all files exceeding the specified size (100 MB here) in the current directory and perform recursive queries.
# find -size +100M./.local/share/Trash/files/linuxmint-15-cinnamon-dvd-32bit.iso./Downloads/Fedora-Live-Desktop-i686-19-1.iso./Downloads/Ant Videos/shakira 2.avi./Downloads/Deewar.avi./Desktop/101MSDCF/MOV02224.AVI./Desktop/101MSDCF/MOV02020.AVI./Desktop/101MSDCF/MOV00406.MP4./Desktop/squeeze.iso
Recursively List Files larger than 1000 MB in the current directory.
root@localhost:/home/avi# find -size +1000M./Downloads/The Dark Knight 2008 hindi BRRip 720p/The Dark Knight.mkv.part./Downloads/Saudagar - (1991) - DVDRiP - x264 - AAC 5.1 - Chapters - Esubs - [DDR]/Saudagar - (1991) - DVDRiP - x264 - AAC 5.1 - Chapters - Esubs - [DDR].mkv./Downloads/Deewar.avi./Desktop/squeeze.iso
49. pdftk
The pdftk command is used to merge several PDF files. You must install the pdftk program. If not, use apt or yum to obtain the corresponding package.
$ pdftk 1.pdf 2.pdf 3.pdf …. 10.pdf cat output merged.pdf
50. ps-LF-u user_name
This command outputs a user's process and thread. Option "L" (list threads) and option "-F" (fully formatted)
$ ps -LF -u aviavi 21645 3717 21766 0 5 66168 117164 1 18:58 ? 00:00:00 /usr/avi 21645 3717 21768 0 5 66168 117164 1 18:58 ? 00:00:00 /usr/avi 22314 3717 22314 0 2 42797 50332 0 19:00 ? 00:00:40 /usr/avi 22314 3717 22316 0 2 42797 50332 1 19:00 ? 00:00:00 /usr/avi 22678 24621 22678 0 1 969 1060 1 21:05 pts/1 00:00:00 ps -Lavi 23051 3717 23051 0 2 37583 45444 1 19:03 ? 00:00:52 /usr/avi 23051 3717 23053 0 2 37583 45444 0 19:03 ? 00:00:03 /usr/avi 23652 1 23652 0 2 22092 12520 0 19:06 ? 00:00:22 gnomeavi 23652 1 23655 0 2 22092 12520 0 19:06 ? 00:00:00 gnome
51. startx-: 1
Share X sessions. If you need to log on to or log out of the desktop frequently (with different user identities), you need startx for rescue. This command creates a new session to avoid repeated login and logout in a session. To exchange data between sessions X, you can use the combination of 'ctrl + Alt + F7 'and 'ctrl + Alt + f8.
Note: The shortcut key "ctrl + Alt + F1 ~ F6 "It was prepared for the console session, and" ctrl + Alt + F7 ~ F12 "indicates X session service. Therefore, we have 6 console sessions and 6 X sessions without frequent logon and logout. The above sequence applies to most releases, but different releases may have different implementations. I tried it In Debian and it runs very well.
The above is all of today's content. If necessary, we will continue to release "little-known commands" in future articles. Do not forget to leave your valuable comments on our articles and the 'little-known Linux command' series. I will bring my new articles soon. Please wait and remember to come back for a long time.
Ten Linux commands that are rarely known-Part 2
Ten Linux commands that are rarely known-Part 3
11 Linux commands that are rarely known but useful
Linux Command cd
Cat for Linux commands
Linux Command alias/unalias
Linux Command Parsing: su root and su-root