Domain Name Forum  

Go Back   Domain Name Forum > Web Design & Development > Programming > Shell Scripting

Reply
 
Thread Tools Display Modes
  #1  
Old 03-19-2011, 09:40 PM
webdev webdev is offline
Senior Member
 
Join Date: Jun 2009
Posts: 7,868
Default grep all but first line

"ps aux" outputs the following as the first line: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND how can I preserve this line if I do a "ps aux | grep " so that I can still see the header for each column? In essence, I want to grep all but the first line...
__________________
Website Development
Domain Name Forum
Reply With Quote
  #2  
Old 07-29-2017, 11:55 AM
steffidsouza46 steffidsouza46 is offline
Member
 
Join Date: Jun 2017
Posts: 60
Default

The -n +2 means “start passing through on the second line of output”. This is a quick hacky way: ls -lart. grep -v ^total . Basically, remove any lines that start with "total", which in ls output should only be the first line.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:51 PM.

| Webmaster Forum | | Domain Name Forum |



Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.