Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-01-2004, 03:33 AM
|
#1
|
|
Senior Member
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070
Rep:
|
Removing Columns From Output
When I run the ps -ef command I get output. One line is:
Code:
user 12822 1 0 Jul31 ? 00:00:00 kalarmd -session 10a862bbf000106887608500000026650004
Now I need to remove everything to the right of the TIME column leaving only the CMD column.
So what will be left is
Code:
kalarmd -session 10a862bbf000106887608500000026650004
There are different numbers of columns for the processes on the right but I need all that.
Anyone know how to do this?
Last edited by darthtux; 08-01-2004 at 03:35 AM.
|
|
|
|
08-01-2004, 03:45 AM
|
#2
|
|
Senior Member
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: Ubuntu, FreeBSD, NetBSD
Posts: 1,449
Rep:
|
ps -eo cmdline
That *should* just spit out the full command line.
|
|
|
|
08-01-2004, 05:27 AM
|
#3
|
|
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530
Rep: 
|
Quote:
Originally posted by frob23
ps -eo cmdline
That *should* just spit out the full command line.
|
Remove the red part to make it work:
|
|
|
|
08-01-2004, 07:38 PM
|
#4
|
|
Senior Member
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070
Original Poster
Rep:
|
Thank you very much. That worked.
Now how to I get only the first column or only the user? What I am trying to do is take the output of ps -ef *before* and *after* reboot (into two files), have only the user and cmd info from each file, do a diff and then paste. The resulting output being the difference in the two files. The PID's etc. will change so I only want to diff and paste the user and cmd info.
Last edited by darthtux; 08-01-2004 at 07:43 PM.
|
|
|
|
08-01-2004, 09:21 PM
|
#5
|
|
Moderator
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,816
Rep: 
|
Then it's:
You will likely have to sort prior to diffing.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:39 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|