Linux operating system--common commands

Preface : The linux command is a command to manage the Linux system. For the Linux system, whether it is the central processing unit, memory, disk drive, keyboard, mouse, or user, etc. are all files, the commands of Linux system management are the core of its normal operation, similar to the previous DOS commands. There are two types of linux commands in the system: built-in shell commands and Linux commands.

I can't remember the ps command. I am familiar with some basic commands. I have an impression of others. When I need it, I know how to check it and where to check it. Now, no one is constantly surfing the Internet, just Baidu.

Table of contents

Online query and help commands 

File and directory manipulation commands

View files and content processing commands

File compression and decompression commands

User Management Commands

Basic network operation commands

System permissions and user authorization related commands

built-in commands and others

Shutdown/restart/logout and view system information commands

Process management commands


Online query and help commands 

1.man view command help, command dictionary

2. info more complex command help

3.help View the help of Linux built-in commands, such as the cd command.

For example:

File and directory manipulation commands

ls

Quanpin list, the function is to list the content of the directory and its content attribute information.

cd

Quanpin change directory, the function is to switch from the current working directory to the specified working directory.

cp

Quanpin copy, its function is to copy files or directories.

find

The meaning of search is used to find the directory and the files under the directory.

mkdir

Quanpin make directories, its function is to create directories.

mv

Quanpin move, its function is to move or rename files.

pwd

Quanpin print working directory, its function is to display the absolute path of the current working directory.

rename

Used to rename files.

rm

Quanpin remove, its function is to delete one or more files or directories.

is rm

Quanpin remove empty directories, the function is to delete empty directories.

touch

Create a new empty file, changing the timestamp attribute of an existing file.

tree

The function is to display the contents of the directory in a tree structure.

Some of these commands can also add parameters, take ls as an example:

It has some parameters:

  • -l : list the attribute permissions of the file
  • -a : list all files, including hidden files
  • -d : list only the directory itself
  • -h: list the file capacity
  • -R : list along with the contents of subdirectories

for example:

The rest of the parameters are not very commonly used, you can try it yourself if you are interested.

View files and content processing commands

cat

Quanpin concatenate, the function is to connect multiple files and print to the screen output or redirect to the specified file.

more

Display the contents of the file in pages.

head

Displays the header of the file contents.

tail

Display the tail of the file contents.

cut

Split each line of the file by the specified delimiter and output.

split

Split files into different small pieces.

paste

Merge file contents by line.

sort

Sort the text content of the file.

unique

Remove duplicate rows. old boy

wc

Count the number of lines, words or bytes of a file.

vi/vim

Command line text editor.

Next we write something with vim and read it with cat:

First create a txt file called demo

vim demo.txt

Press i to enter input mode, type a line, then press ESC, :wq  to save and exit

 Let's take a look:

 cat read:

Isn't it super easy!

File compression and decompression commands

tar

Pack and compress. old boy

unzip

unzip files.

gzip

gzip compression tool.

zip

Compression tool.

User Management Commands

useradd

Add user.

usermod

Modify the user attributes that already exist in the system.

userdel

delete users.

groupadd

Add user groups.

passwd

Modify user password.

change

Modify the validity period of the user password.

id

View the user's uid, gid and user group to which they belong.

are

Switch user identities.

visado

Exclusive command for editing the /etc/sudoers file.

sudo

Execute the command as another user (root by default).

Basic network operation commands

ssh

Log in remotely using the SSH encryption protocol.

wget

Download files from the command line.

ping

Test the connectivity of the network between the hosts.

ifconfig

Commands to view, configure, enable or disable network interfaces.

System permissions and user authorization related commands

chmod

Change file or directory permissions.

chown

Change the user group to which a file or directory belongs.

built-in commands and others

echo

Print the variable, or directly output the specified string

printf

Format the result to standard output.

rpm

Commands for managing rpm packages.

yum

自动化简单化地管理 rpm 包的命令。

watch

周期性的执行给定的命令,并将命令的输出以全屏方式显示。

clear

清除屏幕,简称清屏。

history

查看命令执行的历史纪录。

time

计算命令执行时间。

关机 / 重启 / 注销和查看系统信息的命令

shutdown

关机。

poweroff

关闭电源。

logout

退出当前登录的 Shell。

exit

退出当前登录的 Shell。

进程管理命令

kill

终止进程。

crontab

定时任务命令。

ps

显示进程的快照。

pstree

树形显示进程。

nice/renice

调整程序运行的优先级。

nohup

忽略挂起信号运行指定的命令。

init

切换运行级别。

service

启动、停止、重新启动和关闭系统服务,还可以显示所有系统服务的当前状态。

站在青春的夕阳下,感受着过往,留下浅浅的笑靥,这大概就是我们的狂欢过得青春。

cc lyn

Guess you like

Origin blog.csdn.net/qq_52213943/article/details/123882129