Regular expressions and basic shell scripts

1, / etc / passwd file in the default shell the number of non-users / sbin / nologin, and the user is displayed
getent passwd | grep -v "/ sbin / nologin $" | cut -d: -f1 | nl | -NR Sort
Regular expressions and basic shell scripts
2, isolated UID maximum user name, UID and shell type
the getent the passwd | Cut -d: -f1,3,7 | -t Sort: -k2 -NR | head -1 Regular expressions and basic shell scripts
. 3, connect the current statistics IP link every remote host machine number and descending order
netstat -tan | grep "the ESTABLISHED" | TR -s '' ':' | Cut -d: -F6 | the Sort -nr | uniq -c
Regular expressions and basic shell scripts
4 , scripting creatuser.sh, achieve the following functions, using a user name as a parameter, if the user specifies parameters exists to show the user already exists, otherwise add it and show id number and other information
Regular expressions and basic shell scripts
script 5, write a script to generate the basic format , including the author, contact information, version, time, and descriptionRegular expressions and basic shell scripts

Guess you like

Origin blog.51cto.com/14688937/2478592