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 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 knowledge points of linux SHELL". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the knowledge points of linux SHELL"?

Alias displays all current command aliases alias lm= "ls-al" command aliases unalias lm cancel command aliases

Type is similar to which

Exprot sets or displays environment variables

Exprot PATH= "$PATH": / sbin add / sbin into PATH path

Echo $PATH displays the PATH path

Bash access subroutine

Name=yang setting variable

Unset name cancel variable

Echo $name displays the contents of the variable

Myname= "$name its me" & $name loses variable content in myname='$name its me' single quotation marks

Ciw=/etc/sysconfig/network-scripts/ setting path

Env lists all environment variables

Echo $RANDOM displays randomly generated numbers

Set sets SHELL

PS1=' [\ u @\ h\ w\ A #\ #]\ $'prompt character setting

[root@linux ~] # read [- pt] variable-read variables entered by the keyboard

Parameters:

-p: prompt characters can be followed by prompt characters!

-t: the number of seconds you can wait later! "

Declare declares the shell variable

Ulimit-a displays all restricted data

Ls / tmp/yang & & echo "exist" | | echo "not exist"

It means that when ls / tmp/yang is executed, if it is correct, echo "exist" is executed, and if there is a problem, echo "not exist" is executed.

Echo $PATH | cut-d':'- f 5 reads paragraph 5 with: as the delimiter

Export | cut-c 10-20 reads the 10th to 20th bytes

Last | grep 'root' search for a line with root, plus [- v] reverse search

Cat / etc/passwd | sort sort display

Cat / etc/passwd | wc displays "lines, words, bytes"

Normal representation

[root@test root] # grep [- acinv] 'search string' filename

Parameter description:

-a: search binary files in the form of text files

-c: count the number of times' search string'is found

-I: ignore the case difference, so the case is considered the same

-n: output the line number by the way

-v: reverse selection, that is, the line that shows no 'search string' content!

Grep-n 'the' 123.txt search for the characters search for specific strings

Grep-n't [EA] st' 123.txt search test or taste two characters use [] to search for collection characters

Grep-n'[^ g] oo' 123.txt search for oo directions that are not previously g select [^]

Grep-n'[0-9] '123.txt search for numbers with 0-9

Grep-n'^ the' 123.txt search with the as the first line to search ^

Grep-n'^ [^ a-zA-Z] '123.txt search does not start with an English letter

Grep-n'[a murz] $'123.txt search for the end of a line ending with amurz search $

Grep-n'g... d '123.txt searches for any character that begins g and ends d characters.

Grep-n 'ooo*' 123.txt search for repeating characters with at least two oo characters *

The sed text stream editor uses script commands to process text files

Awd mode scanning and processing language

Nl 123.txt | sed '2Query 5d' delete the second to fifth lines

Differences in diff comparison files

Cmp compares whether there are differences between the two files.

Patch patch file

Format the file to be printed by pr

At this point, I believe you have a deeper understanding of "what are the knowledge points of linux SHELL?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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