The second operation of the new Linux+python high-end operation and Maintenance class

Source: Internet
Author: User

1. Who | Cut-d '-f1 | Sort-u

2.cut-d:-f7/etc/passwd | uniq-c | Sort-rn | Head-n-1

3.SORT-T:-k3-n/etc/passwd |tail-n-10 | Tr ' A-Z ' A-Z ' > Tmp/maxusers.txt

4.ifconfig | Head-n-2 | Tail-n-1 | Cut-d:-f2 | Tr-d "Bcast"

5.ls/var/|wc-w

6.SORT-T:-k3n/etc/group | Head-n-10 | Cut-d:-f1

7.cat/etc/fstab/etc/issue >/tmp/etc.test

8.groupadd-g Disto

Useradd-u 1005-g distro Mandriva

Useradd-u 1100-d/home/linux Mageia

echo "Mageedu" | passwd--stdin Mageia

Userdel Mandriva

Useradd-u 2002-g disrto-g Peguin Slackware

Usermod-s/bin/tcsh Slackware

Usermod-ag Admins Slackware

Passwd-n 3-x 183-w 3 Slackware

Useradd-u 3003-g clouds-g Peguin,nova OpenStack

Useradd-s/sbin/nologin Mysal

echo "passwd" | passwd stdin "OpenStack"

9.cp-r/etc/skel/home

Mv/home/skel/home/tuser1

chmod g-r,o-r/home/tuser1

Ll-a/home/tuser1 | grep tuser1

chmod g-r,o-r/home/tuwer1/.*

Ll-a/home/tuser1


10.cat/etc/passwd | grep-e ^ (s| S

cat/etc/passwd | Grep-e-I. ^s

cat/etc/passwd | GREP-E ^[ss]

cat/etc/passwd | Grep-e "^s"-E "^s"

11.cat/etc/passwd | Grep-e-V "/bin/nologin$"

cat/etc/passwd | Grep-e "/bin/nologin$"

cat/etc/passwd | grep "\<[0-9]\{2,3\}\>"

grep "^#[[:space:]]\+[^[:space:]"/etc/rc.d/rc.sysinit

15.netstat-tan | grep "listen[[:space:]]*$"

16.useradd Bash

Useradd Testbash

Useradd basher

Useradd-s/sbin/nologin Nologin

# egrep "^ ([[:alnum:]]+\>). *\1$"/etc/passwd


The second operation of the new Linux+python high-end operation and Maintenance class

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.