51 Lesser-Known Linux Commands for Power Users
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!

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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The Internet does not rely on a single operating system, but Linux plays an important role in it. Linux is widely used in servers and network devices and is popular for its stability, security and scalability.

The core of the Linux operating system is its command line interface, which can perform various operations through the command line. 1. File and directory operations use ls, cd, mkdir, rm and other commands to manage files and directories. 2. User and permission management ensures system security and resource allocation through useradd, passwd, chmod and other commands. 3. Process management uses ps, kill and other commands to monitor and control system processes. 4. Network operations include ping, ifconfig, ssh and other commands to configure and manage network connections. 5. System monitoring and maintenance use commands such as top, df, du to understand the system's operating status and resource usage.

The average annual salary of Linux administrators is $75,000 to $95,000 in the United States and €40,000 to €60,000 in Europe. To increase salary, you can: 1. Continuously learn new technologies, such as cloud computing and container technology; 2. Accumulate project experience and establish Portfolio; 3. Establish a professional network and expand your network.

The main tasks of Linux system administrators include system monitoring and performance tuning, user management, software package management, security management and backup, troubleshooting and resolution, performance optimization and best practices. 1. Use top, htop and other tools to monitor system performance and tune it. 2. Manage user accounts and permissions through useradd commands and other commands. 3. Use apt and yum to manage software packages to ensure system updates and security. 4. Configure a firewall, monitor logs, and perform data backup to ensure system security. 5. Troubleshoot and resolve through log analysis and tool use. 6. Optimize kernel parameters and application configuration, and follow best practices to improve system performance and stability.

Introduction Linux is a powerful operating system favored by developers, system administrators, and power users due to its flexibility and efficiency. However, frequently using long and complex commands can be tedious and er

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

Linux is suitable for servers, development environments, and embedded systems. 1. As a server operating system, Linux is stable and efficient, and is often used to deploy high-concurrency applications. 2. As a development environment, Linux provides efficient command line tools and package management systems to improve development efficiency. 3. In embedded systems, Linux is lightweight and customizable, suitable for environments with limited resources.

The main differences between Linux and Windows in virtualization support are: 1) Linux provides KVM and Xen, with outstanding performance and flexibility, suitable for high customization environments; 2) Windows supports virtualization through Hyper-V, with a friendly interface, and is closely integrated with the Microsoft ecosystem, suitable for enterprises that rely on Microsoft software.
