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 common commands of linux system

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "what are the common commands of the linux system". In the daily operation, I believe that many people have doubts about the common commands of the linux system. The editor consulted all kinds of materials and sorted out the simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what are the common commands of the linux system?" Next, please follow the editor to study!

1.Linux version centOs 6.7

1.1 preparation work

(1) install the virtual machine:

(2) Linux system:

(3) CRT (Linux client):

two。 Common command

(1) pwd: view the current location

By default, the location of the root account after entry is under the root folder

Other accounts are in the home directory by default.

(2) cd / return to the root directory

(3) ll to view the files, directories and shortcuts under the directory

How to distinguish the three kinds of files?

D: directory -: file l: shortcut key

(4) clear clearance

(5) cd directory name: enter that directory

(6) cd.. And cd-

(7) cd ~ go home

(8) mkdir directory name: create a directory (here is just a directory, not this command for file creation)

Method 1: create a directory at a single level

Normally, we will install our own software under usr/local.

Method 2: cascade create directory mkdir-p directory 1 / directory 2 / directory 3.

(9) rmdir deletes an empty directory

(10) Vim editor creates or edits files

(11) rm directory (or file) delete a directory or file

11.1 single-step delete file query

11.2 delete files in a single step without asking

11.3 Delete a directory

Ask for deletion

Delete directly (delete files or directories that exist in a directory)

(12) View the contents of the file

12.1 cat file name: view everything in the file without paging

12.2 more file name: with paging function, the space displays the next page of data, enter to display the next line of data.

12.3 less file name: PgUp and PgDn to turn the page up and down.

12.4 tail is used to display the next few lines of the file.

(13) cp copy content

13.1 copy content

13.2 copy the content and change the name

(14) mv move or rename

(15) [tar] command: (* Packaging or decompressing)

Common parameters:

-c: create a new tar file

-v: displays information about the running process

-f: specify a file name

-z: call the gzip compression command to compress

-t: view the contents of the compressed file

-x: unlock the tar file

Packing

Decompression

Compression:

Decompression

(16) grep finds strings that meet the criteria

(17) help order

(18) Linux process command

(19) Pipeline enquiries

Pipe is an important concept in Linux commands, and its purpose is to use the output of one command as the input of another command.

Ls-- help | more paging to query help information

Ps-ef | grep java query the process with java in its name

(20) Network communication commands

20.1 View the IP of Linux

20.2 turn the network card on / off

20.3 ping detects whether the network is unobstructed

(21) View Linux process and kill process

Ps-ef to view all processes

Ps-ef | grep keyword to view a process

Kill kills a process

Kill 25642 kills the process of 25642

Kill-9 25642 forced kill process

(22) shutdown and restart

Linux centos restart command: reboot

Linux centos shutdown command: halt shuts down immediately

(23) chmod File Authorization

(24) Firewall

24.1 View Linux Firewall status / etc/init.d/iptables status

24.2 temporarily turn on the firewall

24.3 temporarily turn off the firewall

24.4 permanently turn off the firewall (those that need to restart the system)

Chkconfig iptables off permanently shuts down the firewall

24.5 permanently turn on the firewall (those that need to restart the system)

Chkconfig iptables on permanently turns on the firewall

(25) Open the port

/ sbin/iptables-I INPUT-p tcp-- dport 8081-j ACCEPT added to the firewall list

/ etc/rc.d/init.d/iptables save save it

/ etc/init.d/iptables status View Firewall list

At this point, the study of "what are the common commands of the linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report