LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-21-2013, 12:00 AM   #1
ilesterg
Member
 
Registered: Jul 2012
Distribution: Arch, CentOS, OpenSUSE Tumbleweed KDE
Posts: 526

Rep: Reputation: 56
ps -ef command output


Hi all,

Can you please help me understand the meaning of the output from my command ps?

the command is something like
Code:
ps -ef | grep scriptname
and it returned only 1 line. I'm more concerned on the following:
Code:
pts/6
As per this site, this value in the output refers to the terminal associated with my command.

So, does this mean no such process as scriptname runs?

Thanks!
 
Old 10-21-2013, 01:50 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,514

Rep: Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436
In case you get only one line: the returned line refers to the command grep you have just executed.
 
1 members found this post helpful.
Old 10-21-2013, 02:07 AM   #3
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 516

Rep: Reputation: 139Reputation: 139
pts stands for pseudo terminal slave. its nothing but the terminal you are using like gnome-terminal or xterm. pts/6 tells that its pseudo terminal no.6

Another note, when using ps and grep, make habit of using [] on first character. That's because, if you don't it returns pid of the process(es), and also pid of grep command. it major cause of confusion for beginners. for example, in following example, the pid that actually returned is the pid of both firefox and grep.

Code:
$ ps -ef | grep firefox
user     2937     1  4 11:01 ?        00:01:30 /usr/lib64/firefox/firefox
user     3267  3172  0 11:34 pts/1    00:00:00 grep firefox

$ pidof firefox
2937

$ ps -ef | grep [f]irefox
user     2937     1  4 11:01 ?        00:01:30 /usr/lib64/firefox/firefox
 
2 members found this post helpful.
Old 10-21-2013, 02:11 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Another note, when thinking of using ps and grep, make habit of using
Code:
pgrep something
or
Code:
ps -C something
instead!
 
3 members found this post helpful.
Old 10-21-2013, 02:23 AM   #5
ilesterg
Member
 
Registered: Jul 2012
Distribution: Arch, CentOS, OpenSUSE Tumbleweed KDE
Posts: 526

Original Poster
Rep: Reputation: 56
Thanks guys! You all rock!
 
Old 10-21-2013, 02:35 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,514

Rep: Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436Reputation: 2436
if you really want to say thanks just press YES
 
1 members found this post helpful.
Old 10-21-2013, 02:42 AM   #7
ilesterg
Member
 
Registered: Jul 2012
Distribution: Arch, CentOS, OpenSUSE Tumbleweed KDE
Posts: 526

Original Poster
Rep: Reputation: 56
Sure, I just did )
 
  


Reply

Tags
cron


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
Requests to my ISP server are output in the middle of output by any command I run. stf92 Slackware 2 07-10-2012 09:38 AM
How to redirect the output of exec command output in perl? sudhap85 Linux - Newbie 3 08-28-2009 04:35 PM
[SOLVED] append command output to file by giving command in terminal sumeet inani Linux - Newbie 4 07-03-2009 11:36 AM
Grep on output of command returns all output traigo Linux - Newbie 2 02-24-2009 06:15 PM
How do I parse the output of a command that output to standard out? gauol Programming 9 01-17-2008 02:54 PM


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