Note: By practicing, you can avoid adding more escape characters by using the-e option (that is, extending regular expressions) when using grep
1
Cp-r/etc/skel/home/tuser1 && chmod-r 000/home/tuser1
2
Vi/etc/group
3
vi/etc/passwd
4
Cp-r/etc/skel/home/hadoop && chmod 700/home/hadoop
5
Chown-r hadoop:hadoop/home/hadoop/
6
Cat/proc//meminfo | grep "^[s,s]"
Cat/proc//meminfo | Grep-e "^[s| S] "
7.
cat/etc/passwd | Grep-v "/sbin/nologin\>" | Cut-d:-f1
8.
cat/etc/passwd | grep "/bin/bash\>" | Cut-d:-f1
9.
cat/etc/passwd | GREP-E-O "[0-9]{1,2}"
Ten,
cat/boot/grub/grub.conf | grep "^[[:space:]]"
cat/boot/grub/grub.conf | grep "^[[:space:]]\+"
One,
Cat/etc/rc.d/rc.sysinit | grep "^#[[:space:]]\+[^[:space:]]\+"
Cat/etc/rc.d/rc.sysinit | Grep-e "^#[[:space:]]+[^[:space:]]+"
12
Netstat-tan | Grep-e "listen[[:space:]]*$
13
Useradd bash && useradd testbash && useradd basher && useradd-s/sbin/nologin nologin |grep-e "^ ([[:alnum:]]+\>). *\1$ "/etc/passwd
Linux files, user rights, and text processing training