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 Linux terminal commands?

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail what Linux terminal commands are, Xiaobian thinks it is quite practical, so share it for everyone to make a reference, I hope you can gain something after reading this article.

file directory class

1. Create directory: mkdir directory name

2. Delete empty directory: rmdir directory name

3. unconditionally delete subdirectory: rm -rf directory name

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

5. Check your directory: pwd

6. View current directory size: du

7. Display directory file list: ls -l (-a: add display implied directory)

Among them: blue: directory; green: executable file; red: compressed file; light blue: link file; gray: other file; white text on red background: wrong link file

8. Browse files: more filename.txt;less filename.txt

9. copy file: cp source file destination file (-r: include directory)

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

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

II. Drive mount class

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

2. Check disk partition: fdisk -l

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

where: modos--FAT16;vfat--FAT32;ntfs--NTFS; CDROM--iso9660

Supported Chinese name: mount -o iocharset=x /dev/hdax /mnt/directory name (where: x= cp936 or

mount optical drive: mount -t auto /dev/cdrom /mnt/cdrom

mount ISO file: mount -t iso9660 -o loop xxx. iso/path

4. Unmount: mount/mnt/directory name

Unmount all mounts: umount -a

5. Create file system: mkfs -t /dev/hdxx. Where: ftype: ext2, ext3, swap, etc.

III. program installation class

1.RPM package installation: (1) install rpm -ivh somesoft.rpm

(2)reverse install rpm -e somefost.rpm

(3)Query rpm -q somehost or rpm -qpi somehost.rpm(where: p is not installed;i contains information)

(4)Query post-installation location: rpm -ql somepost.rpm

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

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

2. Source code package installation:

View README

Basic Usage (1) Configuration: Extract directory./ configure

(2)Compile: extract directory make

(3)Install: Make install under the extract directory

3.src.rpm installation

IV. Compression decompression class

1.tar.gz class: (1) decompression: tar-xvzf file.tar.gz;(2)tar.gz to tar: gzip-d file.tar.gz(2) compression: gzip to be compressed file

2.tar uncompressed class: (1) unpacking: tar-xvf file.tar;(2) packaging: tar-cvf file.tar file list

3.zip class: (1) decompression: unzip file.zip -d dir;(2) compression: zip zipfile list of files to be compressed

4.bz2 class: (1) decompression: bunzip2 file.bz2 or bzip2 -d file.bz2;(2) compression: bzip2 file to be compressed

5.z class: (1) decompression: uncompress file.z;(2) compression: compress file

v. process control class

1. List the current process ID: ps -auxw

2. Terminate process: (1) Terminate single process: kill process ID number

(2)Terminate all processes of this program: Killall program name

(3)Terminate the X-Window program: xkill

3. View resource usage: (1)top (2)free (3)dmesg

4. View environment variable values: env

5. Restart: (1)reboot (2)Ctrl Alt Del (3)init 6

6. shutdown -h now (2)halt (3)init 0

7. Switch Desktop: switchdesk gnome| KDE|...

vi. program run class

1. Query command: whereis command name

2. Running X-Window program in background: program name &

3. Forcefully exit the X-Window program: Ctrl Alt Backspace

4. View Help:

(1)Simple Help: Command Name--help| less

(2)More help: man command name

(3)info command name

â-o October (4)

5. View system path: echo $PATH

6. View current shell stack: echo $SHLVL

7.

< / >

: Input/output redirection;|: Pipeline left input is pipeline right input

vi. User account class

1. Add user account: (1) User name: adduser User account name

(2)Set password: passwd user account name

2. Delete user account: userdel user account name

3. Add user group: groupadd user group name

4. Delete user group: groupdel user group name

5. Temporary termination of user account: passwd -l user account name

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

7. authority setting

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

where: a--all users;u--this user;g--user group;o--other users

--Add permissions;---Delete permissions;=--Set permissions

File: r--read permission;w--write permission;x--execute permission

Directory: r--Allow to list files and subdirectories under directory;w--Allow to generate and delete files under directory;x--Allow to access directory

(2)chmod xxx file/directory name

where: execute=1;write=2;read=4

x Value: 0--No permission (common);1--Only execute (uncommon);2--Only write (uncommon);3--Only write and execute (uncommon);4--Read only (common);5--Read only and execute (common);6--Read and write (common);7--Read. write, and execute

VII. Editorial category

1. Command mode after entry: (1) insert i;(2) open 0;(3) modify c;(4) replace r;(5) replace s

2. Enter full screen editing mode after (1).

3. Command Mode--> Edit Mode (a/i); Edit Mode--> Command Mode (Esc); Command Mode--> Last Line Mode (:).

4.:w/w newfile save

5.:q/q! exit iv;: wq save exit

VIII. network service

1. Display network interface parameters: ifconfig

2. Display system mail: mail

3. Start/stop web services: httpd -k start| stop| restart

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

(2)Display network status: netstat, where: options: -a== All sockets;-l== Contains network devices;-n== Digital IP;

-o== other information;-r== routing table;-t== TCP sockets only;-u= UDP sockets only;-w== raw sockets only;

-x== column unix Domain sockets only

IX. other classes

1. Display graphics 3D information: glxinfo and glxgears

You need to use the rpmbuild command with the--rebuild parameter. rpmbuild --rebuild ***.src.rpm. Then look under/usr/src/

3. ISO installation under FC3: system-config-packages --isodir=iso directory

RH iso program installation: redhat-config-packages --isodir=iso directory

About "Linux terminal command what" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

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