UNIX-1.6 grep, useradd, usermod commands

Make sure to subscribe to my channel for more videos on UNIX, Perl and SQL.
facebook: facebook.com/fuzicast
twitter: @fuzicast
youtube: youtube.com/yuejdesigner85

last -10 username – get last 10 logins of specific user
passwd – change password
diff -y file1 file2 – find differences between 2 files
grep ‘regex’ file – search for pattern
grep -i ‘regex’ file – case insensitive search
grep -P ‘regex’ file – full support of Perl regex
grep -e ‘regex1’ -e ‘regex2’ file – search for multiple patterns
grep -v ‘regex’ file – inverse of search pattern (return non-matching lines)
grep -n ‘regex’ file – display line number with search result
grep -B4 ‘regex’ file – also display 4 lines before match
watch -n5 command – executes command every 5 second
adduser username – add a new user
usermod username -d /home/newhome – change home for new user
usermod username -d /home/newhome -m – change and move home content to a new home
usermod username -e 2022-05-11 – set account expiration date
usermod username -g group_name – set user group name/id
usermod username -l new_username – change username for user
usermod username -p new_password – change password for user
usermod username -s shell_name – change default shell for user
sudo -u username -i – run future commands as another user