English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Many friends who are just starting to learn Linux are definitely going to need to learn the common Linux commands before getting into Linux. I have just organized them recently. Specifically as follows:
1、Linux startup level [linit n]}
0—System shutdown state
1—Single-user working state
2—Multi-user state (without NFS)
3—Multi-user state (with NFS)
4—System not used, left for users
5—Graphical interface
6—System normal shutdown and restart
Command
Commands related to files and directories
ls [List directory]
cd [Absolute path, and relative path ]
.. //Represents the current path
pwd [Current path]
whoami [Current user]
mkdir [Create directory]
rmdir [Delete directory, can only delete empty directories]
rm [Delete directory or file]
touch [Create file]
cp [Copy]
mv [Move file]
vi [Edit file; there are two modes, edit mode and command mode; the default is to enter command mode]
Command mode:
Edit mode:
Display file content
ln [Link file; divided into soft links and hard links]
whereis ls [Query the relevant content of the ls command, such as the called file, the help document]
echo $PATH [View environment variables]
find /etc -name my*[Find files starting with my in the etc directory]
Create mount point: mount
mount device mount point
sudo mount /dev/cdrom /mnt/cdr # The cdrom directory of Ubuntu is usually "/dev/cdrom"
Unmount mount point: umount
umount [Parameter] device/Mount point
sudo umount /dev/cdrom sudo umount /mnt/cdr
# The above two lines of code perform the same function
The concept of users and groups
File permissions
-rw-r--r--
chmod [Modify file permissions]
Learn chamod 755 4.txt
111|101|101
n chown kang 4.txt [Change file owner]
Permission Setting: chmod
chmod [-[R] Permission Filename
chmod 777 *.js #Permissions of all ".js" files in the current directory are changed to "777" chmod 777 ./css/ #Permissions of the "css" folder in the current directory are changed to "777" but the permissions of its subfolders and subfiles are not changed chmod 777 ./css/* #Permissions of all "first-level folders and files" in the "css" folder in the current directory are changed to "777" but the permissions of the css folder remain unchanged chmod -R 777 ./css/ #Permissions of the "css" folder, its subfolders, and subfiles in the current directory are changed777"
Pipe and others
ls –l /etc | more
cat /etc/passwd | grep student1
grep student 4[In the file .txt]4[Find lines containing the character 'student' in .txt]
wc [Count the number of lines and words in the file]
ls -l | grep "^- | wc –l [Count the number of files in the directory below]
wall “My Name Is Kang !”
That's all for this article. Hope it helps everyone's learning and also hope everyone will support the呐喊 tutorial more.
Declaration: The content of this article is from the Internet, the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, does not undergo human editing, and does not assume relevant legal responsibility. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email to report, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.)