Linux terminal operation commands

We all know that the server is the middleman between software and hardware, and among many systems, Linux has many advantages such as security, stability, free, and high market share. Linux has many application fields, including server field, embedded field, personal desktop field (weak link), etc. Android is an operating system based on Linux.

Basic operation commands of Linux system:
command line input terminal Teminal can directly right-click to open
cd switch folder
cd /home absolute path (beginning with the root directory) to enter the directory / means that the root directory followed by a slash is "的" meaning
cd lironghui Relative path (not starting with the root directory)
(/ — home — admin)
(/ —)
pwd View the path of the current directory
cd… Back to the parent directory
cd …/home Back to the parent directory In the next directory to the parent directory
cd ~ Go back to your home directory
cd-look back and switch between the previous directory and this directory

ls The content list in the current directory.
ls -a displays all files including hidden files (the ones beginning with. are hidden files)
ls -l displays a list of specific contents
ls -lh displays a list of specific contents with different units
ls -lah combined command display
ls -la / View all files in the root directory
ll display content size equal to ls -l

The rmdir command deletes the directory
mkdir creates a folder with a relative path or an absolute path
mkdir /home/home1/test1 -p If the path does not exist, it will automatically create the parent directory for you
mkdir people animal Create multiple folders at the same time
mkdir ren/people Create a folder and create a folder
mkdir ren(nan nv) under that file. Create two folders
touch abc.txt in this folder. Create an empty file
touch.abc.txt in the current directory. Create a hidden empty file
gedit abc.txt Open and edit the file with Notepad

rm abc.txt delete files
rm abc -r delete folders, you can add paths
rm * -r delete all files, but hidden files cannot be deleted

clear Clear the screen
tab Automatic completion
Up and down keys
Type the wrong command ctrl + C End the command
man cd and cd --help View the use of the command

File permissions
drwxrwxr-x d stands for folder-stands for not
r Readable w Writable x Executable The first group refers to the permissions of the file owner, the second group refers to the permissions of the file owner group, and the third group is the permissions of other people

Copy the folder
cp 1.txt test1
cp + the file name to be copied + the folder to copy to (the path can be omitted under one path, and the path must be added under one path)
cp test1 test2 -r copy folder
cp test1 test2 -a Copy all the attributes and paths of test1. The new file name copied is test2

mv move, rename
it is either move within a folder , rename within the same folder
mv test1 test3
mv

ls >1.txt
">" Redirection writes the result returned by the command to the file
"ll >>1.txt"
">>" Append means append the data to the last redirected file and it
can be placed in any command Behind

cat 1.txt
cat View the contents of the file and display the contents of the file on the screen. If there
are multiple files followed, you can view multiple files

more 1.txt Press B to look back to the space and press enter to look down and press Q to exit

Pipeline | Pass the result returned on the left to the right for processing

The gzip command compresses files or folders as .gz files

The ps command displays the running process and some information about the process such as pid, cpu and memory usage

The kill command is used to terminate the process

The top command is a commonly used performance analysis tool under Linux, which can display the resource occupancy status of each process in the system in real time, similar to the task manager of Windows

Guess you like

Origin blog.csdn.net/Krystal_RonghuiLi/article/details/108214327