DAY 10 - GREP | PASSWD | PIPE

r  grep [search word from file | search from system]
 
v  grep [option] <SearchingString[pattern/word]> <FileName[files/directory]>
v  grep -i shohan abc.txt [i means ignore case sensitive]
v  grep -v shohan /opt/ [v means invers search except shohan rest of the content will be displayed]
v  grep -R shohan /etc [R means recursive search inside directory]
v  grep -n shohan /etc [n means line number]
v  grep shohan -A 3 /etc/abc.txt [A means after 3 means three lines]
v  grep shohan -B 3 /etc/abc.txt [B means before 3 means three lines]

r  passwd
 
v  cat /etc/shadow
v  passwd [current user password change option]
v  passwd <username> [only super user can use this command for changing another user password]
v  passwd shohan [Only root can define username]
 
Ãœ  passwd [OPTION] <userName>
Ãœ  passwd -d shohan
 
o   -d --delete [delete the password for the named account]
o   -l --lock [lock the password for the named account]
o   -u --unlock [unlock the password for the named account]
o   -e --expire [expire the password for the named account]
o   -f --force [force operation]
o   -x --maximum=DAYS [maximum password lifetime]
o   -n --minimum=DAYS [minimum password lifetime]
o   -w --warning=DAYS [number of days warning users receives before password expiration]
o   -i --inactive=DAYS [number of days after password expiration when an account becomes disabled --stdin read new tokens from stdin]
 
r  I [pipe works as output then it will work in the next as input]
 
v  Cat -20 file1 | more -10
v  Output   | Input
v  echo redhat | passwd --stdin root
v  echo “red@hat#989” | passwd --stdin shohan
 

Previous Post Next Post

نموذج الاتصال