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 operating methods of Shell

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the operating methods of Shell". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the operating methods of Shell"?

1. We can't deal with the kernel directly. Shell is used to interpret commands and to deal with the kernel.

2. There are different forms of Shell (the same command may not be common in different shell): cshell, bash, kshell, sh (the original shell)

(you can click cshell in bash to switch to cshell, and use exit to exit the current shell)

Add a user group

1. Show user groups: more group

two。 Instruction-- groupadd testg

Note: you must have administrator privileges to perform relevant operations.

Results:

3. Delete a user group:

Groupdel user group name

4. Usermod instruction

Conversion group:

Delete a user:

Delete: userdel * * in the / etc directory (the file has not been deleted)

Then delete it under the / home home directory:

5. When the deletion is not complete:

Switch users

Su-- user name

Exit exit

Note: when a new user logs in, the default is the user's home directory.

File permissions

The 9 bits are divided into three groups, rtel readline w writerexlylym executememe m null (no permission at all)

Group 1: permissions of the owner of the file

Group 2: permissions of file owners in the same group

Group 3: the authority of the rest

Rw-r--r-- said: the file owner cannot read or write, the same group is read-only, others are read-only.

Modify permissions

Directive: chmod + r/w/x + file

If you only give yourself permission to modify, use:

Chmod Ubunx File u--user

Add permissions to the same group:

Chmod Groux file g--group

Other users:

Chmod ointx file o--other

Get all permissions:

Chmod 777 files (in this binary form later)

Note: permissions are represented by 9 digits in unix and linux systems

Modify the file owner

Directive: files that need to be changed for the chown target

File operation instruction

Text display command

Search instruction

Note: be sure to enter the directory before operating.

Grep instructions are very common, so be sure to remember them. This instruction is used to see which process.

Information display instruction

Display disk information

Piping (used a lot)

Note:

1. Paging display (more itself can be paged)

Check how many lines there are in passwd (cat to enumerate passwd and display several lines)

Check that passwd contains lrj characters (grep View instruction)

4. Demessage system boot information, look for the startup information containing eho0 (the first network card), that is, check whether the network card is working properly.

5. Ls-l | grep

(regular expression, beginning of a line) only directories are listed

6. List all the files (links are not listed) grep

Count the number of lines wc-l (that is, how many files are in the current directory)

Enumerate the files in the / etc directory, there will be more, ctral+c ends.

Paged display:

(the sentence before and after the pipe is separated by "|")

Command replacement (not much)

Wall * *-notify everyone that each logged in will see it (verify when two terminals are opened)

Command replacement: the skim on the left side of 1

Redirect (not used much, used when reading other people's scripts)

Standard input, output: stdin, stdout, stderr

Output redirection: > or > >

Enter redirect: < or

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