Linux Basic notes--[001]

Source: Internet
Author: User

A.VI finding text

N, Negative search

B. View the extranet IP

Curl Ifconfig.me

B. Changing to the last visited directory

CD-

D. Remove users from the group:

GPASSWD-D User Name Group name

E. Viewing network card rates

Cat/sys/class/net/eth0/speed

File transfer between F.host and guest

Rcp-r/localdir/[Email protected]:/remotedir

rcp-r [Email Protected]:/remotedir/localdir

G.find related

Find/-path/usr-prune-o-name xxx.txt-perm/4000-group Wheel

Note:-prune excludes/usr folder,/4000 permissions above 4000, corresponds to -4000;-path and-prune as implicit-a logic #+4000 is deprecated since 2005

find/2>&1 | grep xxx Merges processing true&false output because only stdout (1) is passed by default in the redirect operation

H.sed&gawk related

Sed '/xxx/{n;[ Email protected]@[email Protected]} ' text

Note: The search file text contains xxx lines, {n;} The format represents the next line of each row that the operation matches to, in this case the 3rd yyy in its next row is replaced with the ZZZ

Sed-n '/xxx/p;/yyy/p ' text function is equivalent to grep

Gawk--re-interval option turns on extended regular support, new version gawk is turned on by default

I. Several ways to exclude lines in text that contain a word (contiguous string)

Grep-v ' xxx ' text

Gawk '!/xxx/{print $} ' text

Grep-p ' \b (?!. *xxx). *\b ' Text

Note 1:pcre,perl compatable Regular expression

Note 2:0 wide assertion, the so-called "0 wide", that is, the condition itself does not occupy any character bit, unless the special designation, regardless of the positive and negative match, does not display the condition itself content; where [^x] is used, the latter, while excluding X, occupies 1 characters, that is, its location cannot be empty, other uses of XXX) cannot appear after this position xxx, (? <=xxx) cannot appear before this position xxx

Note 3: The regular expression default greedy mode, that is, match the larger range as much as possible, add after quantifiers, or match as small a range as possible

J. Chroot/dir/bin/bash Env-i +h

Note: Env-i refers to all environment variables before clearing chroot, +h refers to canceling the history command cache hash

k.who/whoami/who am I/W "four Brothers"

WHO displays the list of currently logged in users

Who am I displays the UID, which is the actual user

WHOAMI display Eid, active user

W displays more detailed information, including the running program

L. Limit the maximum number of normal user processes, for example 200

echo "* Hard Nproc" >>/etc/security/limits.conf

M. The Association of the Peel Command with its execution terminal

Nohup+commmands

Linux Basic notes--[001]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.