LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-15-2015, 11:55 PM   #1
zama
Member
 
Registered: Mar 2012
Posts: 34

Rep: Reputation: Disabled
To view all process which are associated with a user terminal using ps command


I am generating the following output using ps command.

30535 ? 0:00 sshd:
30536 pts/67 0:00 ps
30537 pts/67 0:00 awk
30627 ? 0:00 /sbin/udevd
30651 ? 2:17 /usr/libexec/udisks-daemon
30658 ? 2:46 udisks-daemon:

The ps command is as follows:


$ ps axl | awk -v "min=500" -v "max=60000" '{ if ( $3 >= min && $3 <=max ) print $3 , $11 , $12 , $13 }'


From the above output , I want only the process ids which are associated with a terminal . How can I generate that output.
 
Old 02-16-2015, 01:27 AM   #2
zama
Member
 
Registered: Mar 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by zama View Post
I am generating the following output using ps command.

30535 ? 0:00 sshd:
30536 pts/67 0:00 ps
30537 pts/67 0:00 awk
30627 ? 0:00 /sbin/udevd
30651 ? 2:17 /usr/libexec/udisks-daemon
30658 ? 2:46 udisks-daemon:

The ps command is as follows:


$ ps axl | awk -v "min=500" -v "max=60000" '{ if ( $3 >= min && $3 <=max ) print $3 , $11 , $12 , $13 }'


From the above output , I want only the process ids which are associated with a terminal . How can I generate that output.


ps -a serves the purpose for me

]$ ps -a | less
PID TTY TIME CMD
341 pts/82 00:00:02 vim
468 pts/136 00:00:00 sqlplus
1353 pts/72 00:00:00 vim
1355 pts/7 00:00:00 res
1564 pts/129 00:00:00 sqlplus
2053 pts/24 00:00:00 vim
2083 pts/8 00:00:00 vim
2471 pts/56 00:00:00 vim
 
  


Reply

Tags
awk, ps


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
Is it possible to view a screen process started by another user? Shimdidly Linux - Server 6 04-20-2012 11:08 AM
command to view total no. or running process only mayankh Linux - Server 3 11-07-2006 04:39 AM
Command or program to view pics from terminal gonus Linux - Software 5 06-29-2006 04:14 PM
view another user's terminal? doza Linux - Software 2 08-18-2004 01:27 PM
Hi, How to view user and root run command on linux? dEMax Linux - General 1 09-12-2003 04:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:49 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
Open Source Consulting | Domain Registration