If you want to learn about the Linux operating system, you must know that the Linux system is getting more and more popular with computer users. To learn about linux, you may want to learn about Linux terminal commands. Here we will introduce the knowledge of Linux terminal commands, I will share it with you here.
I. File directory
1. Create a directory: mkdir directory name
2. Delete the empty directory: rmdir directory name
3. Delete the subdirectory unconditionally: rm-rf directory name
4. Change the current directory: cd directory name (go to the user's home directory: cd ~; Go to the upper-level Directory: cd -)
5. view your own directory: pwd
6. view the current directory size: du
7. display the directory file list: ls-l (-a: add an implicit directory)
Blue: Directory; Green: executable file; Red: compressed file; light blue: linked file; Gray: other files; Red: Wrong link file
8. Browse File: more file name. txt; less file name. txt
9. copy the file: the target file of the cp source file (-r: Contains directory)
10. find the file: (1) find (2) locate command name
11. Link: (1) create a hard link: ln to link the source file (-d: create a directory link); (2) create a symbolic link: ln-s to link the source file
Ii. Driver mounting
1. Check hard disk usage: df-T-h
2. Check the disk partition: fdisk-l
3. mount the hardware and software areas: mount-t/dev/fdx | hdax/mnt/directory name
Among them: modos -- FAT16; vfat -- FAT32; ntfs -- NTFS; optical drive -- iso9660
Supported Chinese names: mount-o iocharset = x/dev/hdax/mnt/directory name (where: x = cp936 or
Mount the optical drive: mount-t auto/dev/cdrom/mnt/cdrom
Mount the ISO file: mount-t iso9660-o loop xxx. iso/path
4. unmount: umount/mnt/directory name
Unmount all: umount-
5. Create a file system: mkfs-t/dev/hdxx. Ftype: ext2, ext3, and swap
Iii. Program Installation
1. RPM package installation: (1) install rpm-ivh somesoft. rpm
(2) reverse install rpm-e somefost. rpm
(3) query rpm-q somefost or rpm-qpi somefost. rpm (where: p is not installed; Information contained in I)
(4) query the location after installation: rpm-ql somefost. rpm
(5) upgrade and install: rpm-Uvh somesoft. rpm
(6) force installation: rpm-ivh -- nodeps somesoft. rpm or rpm-ivh -- nodeps -- force somesoft. rpm
2. Install the source code package:
Read README
Basic usage (1) configuration: extract the directory./configure
(2) Compile: extract the make
(3) installation: make install in the decompressed directory
3. Install src. rpm
Iv. compression and decompression
1.tar.gz class: (1) extract: tar-xvzf file .tar.gz((2)tar.gz to tar: gzip-d file .tar.gz (2) compression: gzip file to be compressed
2.tar uncompressed class: (1) Unpack: tar-xvf file .tar; (2) package: tar-cvf file .tar file list
3.zip: (1) decompress: unzip file. zip-d dir; (2) Compressed: zip zipfile list of files to be compressed
4.bz2: (1) decompress: bunzip2 file. bz2 or bzip2-d file. bz2; (2) compress: bzip2 File to be compressed
5. z class: (1) decompress: uncompress file. z; (2) compress: compress File
5. Process Control
1. List the current process ID: ps-auxw
2. terminate processes: (1) terminate a single process: kill process ID
(2) terminate all processes of the program: Killall program name
(3) Terminate the X-Window program: xkill
3. View resource usage: (1) top (2) free (3) dmesg
4. view the environment variable value: env
5. Restart: (1) reboot (2) Ctrl Alt Del (3) init 6
6. shutdown: (1) shutdown-h now (2) halt (3) init 0
7. Switch the desktop: switchdesk gnome | KDE |...
6. program running
1. query command: whereis command name
2. Run the X-Window program in the background: program name &
3. Forcibly exit the X-Window program: Ctrl Alt Backspace
4. View help:
(1) Concise help: command name -- help | less
(2) more help: man command name
(3) info command name
(4) help command name
5. view the system PATH: echo $ PATH
6. view the current shell Stack: echo $ SHLVL
7. </>: Input/Output redirection. |: The left input of the MPs queue is the right input of the MPs queue.
6. User Accounts
1. Add a user account: (1) User name: adduser User Account Name (2) Set Password: passwd User Account Name
2. delete a user account: userdel User Account Name
3. Add a user group: groupadd user group name
4. delete a user group: groupdel user group name
5. Temporarily terminate the user account: passwd-l User Account Name
6. Restore the account to be terminated: passwd-u User Account Name
7. permission settings
(1) chmod-a | u | g | o |-| = r | w | x file/directory name
Where: a -- all users (all); u -- current user (user); g -- user group (group); o -- other users (other users )-
-Add permissions; --- delete permissions; = -- Set permissions
File: r -- read-Only permission (read); w -- write permission (write); x -- execute permission (execute)
Directory: r -- allow files and subdirectories in the column directory; w -- allow generation and deletion of files in the directory; x -- allow access to this directory
(2) chmod xxx file/directory name
Where: execute = 1; write = 2; read = 4 x value: 0 -- no permission (commonly used); 1 -- only executable (uncommon ); 2 -- write only (uncommon); 3 -- write and execute only (uncommon); 4 -- read-only (common); 5 -- read-only and execute (common ); 6 -- read and write (common); 7 -- read. write and execute
VII. vi editing
1. Enter the command mode: (1) Insert I; (2) Open 0; (3) Modify c; (4) Replace r; (5) replace s
2. After going through (1), enter the full screen editing mode.
3. Command mode --> edit mode (a/I); edit mode --> command mode (Esc); command mode --> last line mode (:).
4. Save w/w newfile
5.: q/q! Exit iv;: wq save and quit
VIII. Network Services
1. display network interface parameters: ifconfig
2. Display System Email: mail
3. start/stop the web Service: httpd-k start | stop | restart
4. View network conditions: (1) online status: ping xxx. xxx;
(2) display network status: netstat, where: options:-a = All sockets;-l = contains network devices;-n = Digital IP; -o = Other information;-r = route table;
-T = only columns of TCP sockets;-u = only columns of UDP sockets;-w = only columns of raw sockets;-x = only columns of unix Domain sockets
9. Other classes
1. Display 3D graphics card information: The -- rebuild parameter must be added to the rpmbuild command for glxinfo and glxgears. For example, rpmbuild -- rebuild ***. src. rpm. Then, find it under/usr/src /.
2. Install the iso program in FC3: directory where system-config-packages -- isodir = iso is located
3. Install the iso program in RH: directory of redhat-config-packages -- isodir = iso
With so many Linux terminal commands, you will learn about Linux well.