LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2012, 12:21 PM   #1
vkivinen
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 10-15-2012, 01:13 PM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
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.

Last edited by shivaa; 10-15-2012 at 01:16 PM.
 
Old 10-15-2012, 01:46 PM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

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

-Tristan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] using awk and grep in a loop nesrin Programming 8 12-06-2010 05:34 AM
[SOLVED] AWK to perform like GREP chuafengru Linux - Newbie 1 07-12-2010 03:11 AM
[SOLVED] Help using awk,sed and grep shakes82 Programming 34 07-07-2010 11:12 PM
Grep and AWK keogk Linux - General 10 01-04-2010 08:03 PM
Help with Bash (grep/awk/etc) piercey Programming 12 02-27-2008 10:21 AM


All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration