Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the knowledge points of Linux terminal commands?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what are the knowledge points of Linux terminal commands, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

I. File directory class

1. Create a directory: mkdir directory name

two。 Delete empty directory: rmdir directory name

3. Unconditionally delete subdirectories: rm-rf directory name

4. Change the current directory: cd directory name (enter user home directory: cd ~; enter higher-level directory: cd -)

5. Check your own directory: pwd

6. View the current directory size: du

7. Show directory file list: ls-l (- a: add display implicit directory)

Where: blue: directory; green: executable; red: compressed file; light blue: linked file; gray: other files; red background and white word: wrong linked file

8. Browse file: more file name.txt; less filename .txt

9. Copy files: cp source files destination files (- r: include directories)

10. Find file: (1) find (2) locate command name

11. Link: (1) establish hard link: ln source file link file (- d: create directory link); (2) establish symbolic link: ln-s source file link file

two。 Driver mount class

1. Check hard disk usage: df-T-h

two。 Check the disk partition: fdisk-l

3. Mount soft and hard light zone: mount-t / dev/fdx | hdax / mnt/ directory name

Among them:: modos--FAT16;vfat--FAT32;ntfs--NTFS; optical drive-iso9660

Support Chinese name: 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 ISO file: mount-t iso9660-o loop xxx.iso / path

4. Unmount: umount / mnt/ directory name

Unmount all mounts: umount-a

5. Set up the file system: mkfs-t / dev/hdxx. Among them: ftype:ext2, ext3, swap, etc.

three。 Program installation class

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; I contains information)

(4) query the location after installation: rpm-ql somefost.rpm

(5) upgrade installation: rpm-Uvh somesoft.rpm

(6) mandatory installation: rpm-ivh-nodeps somesoft.rpm or rpm-ivh-nodeps-force somesoft.rpm

two。 Source code package installation:

Check README

Basic usage (1) configuration: decompress the directory. / configure

(2) compile: decompress the make in the directory

(3) installation: decompress the make install in the directory

Installation of 3.src.rpm

four。 Compression and decompression class

1.tar.gz class: (1) decompress: tar-xvzf file .tar.gz; (2) tar.gz extract to tar:gzip-d file .tar.gz (2) Compression: gzip files to be compressed

2.tar uncompressed classes: (1) unpack: tar-xvf file .tar; (2) package: tar-cvf file. Tar file list

3.zip class: (1) decompress: unzip file. Zip-d dir; (2) Compression: list of files to be compressed by zip zipfile

4.bz2 class: (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

five。 Process control class

1. List the current process ID:ps-auxw

two。 Terminating process: (1) terminating a single process: kill process ID

(2) terminate all processes of the program: Killall program name

(3) terminate the X-Window program: xkill

3. Check the 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 desktops: switchdesk gnome | KDE |...

six。 Program running class

1. Query command: whereis command name

two。 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 input on the left of the pipe is the right input of the pipe.

six。 User account class

1. Add user account number: (1) user name: adduser user account name (2) set password: passwd user account name

two。 Delete user account: userdel user account name

3. Add user group: groupadd user group name

4. Delete user group: groupdel user group name

5. Suspend user account: passwd-l user account name

6. Restore terminated account: passwd-u user account name

7. Permission setting

(1) chmod-a | u | g | o |-| = r | w | x file / directory name

Among them: a muri-all users (all); Umai-local users (user); gmae-user group (group); Omai-other users (other users)-

-add permissions;-delete permissions; =-set permissions

File: RMY-read-only permission (read); WMY-write permission (write); XMY-execute permission (execute)

Directory: RMY-allows files and subdirectories under the column directory; WMY-allows the generation and deletion of files under the directory; XMY-allows access to the directory

(2) chmod xxx file / directory name

Among them: execute=1;write=2;read=4 x values: 0mura-no permissions (commonly used); 1mura-can only execute (uncommon); 2mura-can only write (not common); 3mure-can only write and execute (uncommon); 4mura-read-only (common); 5Muk-read-only and execute (common); 6Mui-read and write (common); 7Mutual-read. Write and execute

VII. VI editing class

1. Enter the command mode: (1) insert I; (2) open 0; (3) modify c; (4) replace r; (5) replace s

two。 Enter full-screen editing mode after (1).

3. Command mode-- > edit mode (aploi); edit mode-- > command mode (Esc); command mode-- > last line mode (:).

4.:w/w newfile save

5.:q/q! Exit iv;:wq Save exit

eight。 Network service

1. Display network interface parameters: ifconfig

two。 Show system email: mail

3. Start / terminate the web service: httpd-k start | stop | restart

4. View network status: (1) online status: ping xxx.xxx.xxx.xxx

(2) display network status: netstat, where: all sockets;-l== of options:-a== contains network devices;-nails = digital IP;-o== other information;-rpm = routing table

-t only = TCP sockets;-u== only UDP sockets;-w== only raw sockets;-x== unix Domain sockets only

nine。 Other classes

1. Display 3D information of the graphics card: glxinfo and glxgears need to use the rpmbuild command plus the-- rebuild parameter. Such as rpmbuild-- rebuild * * .src.rpm. Then look under / usr/src/

Install iso program under 2.FC3: system-config-packages-- the directory where isodir=iso is located

Install iso program under 3.RH: redhat-config-packages-- the directory where isodir=iso is located

These are all the contents of this article entitled "what are the knowledge points of Linux terminal commands?" Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report