When we learn knowledge, we often encounter problems, solve these problems, and have a solid grasp of basic knowledge. Linux is becoming more and more popular. Do you know about Linux? Are you an application of Linux? This article describes common Linux commands in detail and plays a role in learning common Linux commands.
1. Shutdown and restart
1) # init 0 restart # init 6 shutdown to change the system running level)
2) # reboot restart # halt command method)
3) # showdown-h + 5 (shutdown in 5 minutes) # showdown-r + 5 (restart in 5 minutes)
Ii. Common directory operation commands
1) display files and directories: ls-a-l
2) copy a file or directory: the target file of the cp source file
3) Move the file or directory: the target file of the mv source file
4) show file content: cat text file
5) display text by PAGE: more text files or less text files
6) display the lines at the beginning or end of the file: head-3 myfile (display the first 3 lines of myfile ). Or tail-5 myfile.
7) count the number of lines, characters, and characters of the specified text file: $ wc-l myfile: count the number of lines of the myfile file)
8) find the specified file in the file system: $ find-name 'my * '(find the file starting with my in the current directory)
9) query the specified string row by row from one or more specified text files:
$ Grep "my *" file1 file2 (find strings starting with my line by line from file1 and file2)
10) display the current working directory: pwd
11) create directory: mkdir mydir1 (create a directory named mydir1 under the current directory)
12) delete Directory: rmdir mydir1 (delete mydir1 directory)
13) delete a file: rm my *. * (delete all files starting with my)
Iii. Common Information Display commands
1) display the equivalent information of the specified file: stat myfile
2) displays online login users: who
3) display the user's identity: whoami
4) display Host Name: hostname
5) display the operating system name: uname
6) display network interface information: ifconfig
7) test network connectivity: ping the IP address
8) display the network status information: netstat
9) display the current user id: id
Iv. Common backup compression commands
1) package the file directory: tar-option File
Option:-t list the contents of the package file-c create a new package-r append document-x release the file
2) compressed to gz file: gzip
3) compressed to Z file: compress
4) compress the file into bz2: bzip
5. Common system management commands
1) mount the file system. Mount-t vfat/dev/sdb1/mnt/udisk (mount the USB flash drive to/mnt/udisk. Note that the corresponding directory must be created in advance ).
2) Change the file or directory permissions: chmod +-= permission File
For example, chmod u + x, g + w, o + r myfile
3) Change User: su
4) display system process: ps
5) Stop the specified process: kill process number
Master these common Linux commands and be familiar with Linux.
- Basic Linux operating system knowledge
- Introduction to the installation of Fedora Linux
- Learning Manual: poll and select in Linux
- Advantages of the Linux operating system that attracts us
- Linux operating system