![]() ![]() Jan 2 10:51:34 TecMint sudo: pam_unix(sudo:session): session opened for user root by (uid=0) ![]() Jan 2 10:51:34 TecMint sudo: tecmint : TTY=unknown PWD=/home/tecmint USER=root COMMAND=/usr/lib/linuxmint/mintUpdate/checkAPT.py Jan 2 10:45:01 TecMint CRON: pam_unix(cron:session): session closed for user root Jan 2 10:45:01 TecMint CRON: pam_unix(cron:session): session opened for user root by (uid=0) You can use the -n num flag to specify the number of lines to be displayed: ~ $ head /var/log/auth.log Head is used to display the first parts of a file, it outputs the first 10 lines by default. You can read more about What’s Difference Between Grep, Egrep and Fgrep in Linux?. Note: The main program is grep, the variations are simply the same as using specific grep options as below (and they are still being used for backward compatibility): $ egrep = grep -Eīelow are some basic grep commands: ~ $ grep "aaronkilik" /etc/passwdĪaronkilik:x:1001:1001::/home/aaronkilik: ~ $ cat /etc/passwd | grep "aronkilik"Īaronkilik:x:1001:1001::/home/aaronkilik: They read lines from a file or standard input, and print all matching lines by default to standard output. These filters output lines matching a given pattern. The sed man page has added control options and instructions: $ man sed 15 Useful ‘sed’ Command Tips and Tricks for Daily Linux System Administration Tasks.How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux.We’ve already written a two useful articles on sed, that you can go through it here: Sed is a powerful stream editor for filtering and transforming text. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |