LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   using grep and awk in threads (https://www.linuxquestions.org/questions/linux-newbie-8/using-grep-and-awk-in-threads-4175432327/)

vkivinen 10-15-2012 12:21 PM

using grep and awk in threads
 
What is the best way to use grep and awk together to find users names when they are logged in.

shivaa 10-15-2012 01:13 PM

Learning grep and awk is good, but not always necessory for getting information about logged in users.
You can simply use "who" or "w" commands to get the list of users currently logged in to the system.
Meanwhile, grep and awk both are filters, and used to manipulate the output of some command. Grep is normally used to filter some "keyword" from stream of data, whereas awk is a multi-function interpreter launguage, commonly used to cut field (columns) of some data stream.

trist007 10-15-2012 01:46 PM

Another good one is "last". It does ftp and ssh logins along with timestamps for login and logout.

-Tristan


All times are GMT -5. The time now is 04:27 PM.