LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 05-01-2015, 03:27 PM   #1
willc86
Member
 
Registered: Dec 2014
Posts: 54

Rep: Reputation: Disabled
what does ps aux | egrep......mean?


Hey guys well, i killed a user that was ssh into my machine and a googled how to do it, however the command that I used to find he PID was

ps aux | egrep "sshd: [a-zA-Z]+@"

why not just use ps aux | grep sshd?

also can someone decipher what ps aux | egrep "sshd: [a-zA-Z]+@" means? I am not that advanced to understand what I googled on that? Also, is there a good tutorial to teach you those commands in depth like that? And what are they called? the (egrep "sshd: [a-zA-Z]+@") part.
 
Old 05-01-2015, 03:44 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
[a-zA-Z] simply matches any character between a-z or A-Z
+ means repeat the previous search N times
@ is a literal "@" symbol

So it just searches for the string "sshd: name@", where "name" could be any combination of lower or uppercase characters.

You could have done a "ps aux | grep sshd", it would simply return a few more matches, like the sshd process itself and your grep command.
 
  


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
ps aux columns fachhoch@gmail.com Linux - Newbie 1 03-11-2013 02:16 PM
[SOLVED] sar -q and ps aux vc_neto Linux - Server 4 01-17-2013 12:51 PM
how to log ps -aux ? frenchn00b Programming 4 11-04-2008 04:32 PM
ps aux and top graziano1968 Linux - Server 1 11-30-2007 10:58 AM
help me analyze the output of ps -aux slackist Linux - Newbie 5 03-28-2004 09:20 AM


All times are GMT -5. The time now is 03:06 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