Linux is known for its powerful set of command-line tools that allow users to interact with the system efficiently. While many Linux users are familiar with common commands such as ls
, cd
, or grep
, there are also few lesser-known but extremely useful commands and shortcuts that can simplify and increase productivity.
We are excited to share our latest five articles on " less known Linux commands " with over 50 commands you may not know about.
This article integrates these five articles into a simple guide, briefly summarizing the functions and examples of each command.sudo !!
If you forget to run the command with sudo
, you don't need to rewrite the entire command. Just type sudo !!
and it will execute the last command using sudo
.
<code>apt update权限被拒绝**sudo !!** sudo apt update</code>
python -m SimpleHTTPServer
Create a simple web page for the current working directory on port 8000.
<code>python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ...</code>
mtr
command
Combining ping and traceroute, display network status in real time.
<code>mtr google.com</code>
Ctrl xe
Opens the terminal's default text editor, allowing you to edit the current command before running.
For example, press Ctrl x
in the terminal and then e
to open the command in the editor.
nl
command
Output text file content with line number.
<code>nl file.txt 1 这是第一行2 这是第二行</code>
shuf
command
Randomly select lines or shuffle content in the file.
<code>shuf -n 3 file.txt</code>
ss
command
Shows socket statistics and active connections.
<code>ss -tuln</code>
<code>last</code> command
Displays the history of the last logged in user.
<code>last</code>
<code>curl ifconfig.me</code>
Displays the external IP address of the machine.
<code>curl ifconfig.me</code>
<code>tree</code> command
Display files and directories in a tree structure.
<code>tree</code>
<code>pstree</code>
Displays a hierarchical view of the running process.
<code>pstree</code>
<space>命令<space></space></space>
Prevent commands from being saved to history.
<code><space> ls<space></space></space></code>
stat
command
Displays detailed status information of the file or file system.
<code>stat file.txt</code>
<alt>.</alt>
<esc>.</esc>
Reuse the last parameter of the previous command.
<code>echo foo<alt> .</alt></code>
pv
command
Simulate Hollywood style text stream.
<code>echo "正在加载..." | pv -qL 10</code>
<code>mount | column -t</code>
Displays mounted file systems in a well-formatted manner.
<code>mount | column -t</code>
Ctrl l
Clear the terminal screen immediately by pressing Ctrl l
in the terminal.
curl
command
Get unread Gmail messages in the terminal.
<code>curl -u username --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "$1\n" if /</code> (.*)/'
screen
command
Separate and reconnect long-running processes from the terminal.
<code>screen -S session_name</code>
file
command
Identify the type of file.
<code>file file.txt</code>
<code>id</code> command
Print user and group ID information.
<code>id</code>
^foo^bar
Replace foo
from the previous command with bar
.
<code>echo foo ^foo^bar</code>
<code>> file.txt</code>
Refresh the contents of the file from the command prompt.
<code>> file.txt</code>
at
command
Schedule the command to run later.
<code>echo "shutdown now" | at 23:00</code>
du
command
Displays the size of files and folders in the current directory.
<code>du -h --max-depth=1</code>
expr
command
Solve simple mathematical calculations in the terminal.
<code>expr 3 5</code>
look
command
Check the words in the dictionary.
<code>look apple</code>
yes
command
Repeat output string until interrupted.
<code>yes "我将学习Linux!"</code>
factor
command
Shows all factors of the given number.
<code>factor 12</code>
ping
command
When the host is online, use sound feedback to ping the host.
<code>ping -i 60 -a 8.8.8.8</code>
tac
command
Output the contents of the file in reverse order.
<code>tac file.txt</code>
strace
command
Debugging tool for tracking system calls.
<code>strace ls</code>
disown
command
Run commands in the background even after the terminal is closed.
<code>sleep 1000 & disown -a && exit</code>
getconf
command
Displays the system architecture (32-bit or 64-bit).
<code>getconf LONG_BIT</code>
while
command
Display the date and time in the upper right corner of the terminal.
<code>while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done &</code>
convert
command
Converts the output of the command to an image.
<code>convert input.jpg output.png</code>
watch
command
Display animated digital clock in the terminal.
<code>watch -t -n1 "date %T|figlet"</code>
host
anddig
commands
DNS lookup utility.
<code>host google.com dig google.com</code>
<code>dstat</code> command
Generate real-time system resource statistics.
<code>dstat</code>
bind
command
Shows all Bash key bindings.
<code>bind -p</code>
touch
command
Force file system checks on the next restart.
<code>sudo touch /forcefsck</code>
lsb_release
command
Print Linux distribution information.
<code>lsb_release -a</code>
nc
command
Check if a specific port is open.
<code>nc -zv localhost 22</code>
<code>curl ipinfo.io</code>
Output geographic information about the IP address.
<code>curl ipinfo.io</code>
find
command
List all files owned by user xyz.
<code>find . -user xyz</code>
apt
command
Install all build dependencies for the package.
<code>sudo apt build-dep vim</code>
lsof
command
This command lists all services or processes currently listening on TCP port 80.
<code>lsof -iTCP:80 -sTCP:LISTEN</code>
find -size 100M
This command searches all files and folders in the current directory and its subdirectories that are larger than 100 megabytes.
<code>find . -size 100M</code>
pdftk
command
pdftk is a powerful command line tool that allows you to manipulate PDF files, including merging multiple PDF files into one.
<code>pdftk file1.pdf file2.pdf cat output combined.pdf</code>
ps -LF -u user_name
This command displays all processes and threads for the specified user, including detailed information about the status of each thread.
<code>ps -LF -u john</code>
<code>startx -- :1</code>
This command starts a new X session on display :1
, which is useful for running multiple graphical user interfaces simultaneously on different screens.
<code>startx -- :1</code>
That's all for the time being! Don't forget to share your thoughts in the comment section. This is not the end of the little-known Linux commands; we will continue to bring you more in the following articles.
I will soon return to our readers with another interesting and useful article. Until then, please continue to follow Tecmint.com!
The above is the detailed content of 51 Lesser-Known Linux Commands for Power Users. For more information, please follow other related articles on the PHP Chinese website!

Linux systems rely on firewalls to safeguard against unauthorized network access. These software barriers control network traffic, permitting or blocking data packets based on predefined rules. Operating primarily at the network layer, they manage

Determining if your Linux system is a desktop or laptop is crucial for system optimization. This guide outlines simple commands to identify your system type. The hostnamectl Command: This command provides a concise way to check your system's chassis

Guide to adjust the number of TCP/IP connections for Linux servers Linux systems are often used in servers and network applications. Administrators often encounter the problem that the number of TCP/IP connections reaches the upper limit, resulting in user connection errors. This article will guide you how to improve the maximum number of TCP/IP connections in Linux systems. Understanding TCP/IP connection number TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication protocol of the Internet. Each TCP connection requires system resources. When there are too many active connections, the system may reject new connections or slow down. By increasing the maximum number of connections allowed, server performance can be improved and more concurrent users can be handled. Check the current number of Linux connections limits Change settings

SVG (Scalable Vector Graphics) files are ideal for logos and illustrations due to their resizability without quality loss. However, PNG (Portable Network Graphics) format often offers better compatibility with websites and applications. This guide d

LiveCode: A Cross-Platform Development Revolution LiveCode, a programming language debuting in 1993, simplifies app development for everyone. Its high-level, English-like syntax and dynamic typing enable the creation of robust applications with ease

This guide provides a step-by-step process for resetting a malfunctioning USB device via the Linux command line. Troubleshooting unresponsive or disconnected USB drives is simplified using these commands. Step 1: Identifying Your USB Device First, i

Temporarily setting a static IP address on Linux is invaluable for network troubleshooting or specific session configurations. This guide details how to achieve this using command-line tools, noting that the changes are not persistent across reboots

Linux is known for its powerful set of command-line tools that allow users to interact with the system efficiently. While many Linux users are familiar with common commands such as ls, cd, or grep, there are also few lesser-known but extremely useful commands and shortcuts that can simplify and increase productivity. We are excited to share our latest five articles on "less known Linux commands" with over 50 commands you may not know about. You may also like: 11 little-known practical Linux commands – Part 1 10 little-known Linux commands – Part 2 10 little-known Linux commands – Part 3 10 little-known valid Linux commands


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
