The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
if command not having the right output filthymonk Shell Programming and Scripting 9 05-23-2007 01:11 AM
[non-important] Indent here-docs? yongho UNIX for Dummies Questions & Answers 4 06-21-2005 10:51 AM
vim indent Virtuosso UNIX for Dummies Questions & Answers 4 02-06-2003 05:15 PM
Output of ps command ls1429 UNIX for Dummies Questions & Answers 1 02-03-2003 10:40 AM
Auto indent in vi sierra_aar UNIX for Dummies Questions & Answers 1 06-19-2002 10:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-06-2005
ssray23 ssray23 is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 2
Indent output of an UNIX command

Hi,

How do I indent 4 spaces for standard UNIX commands like ls -ltr (or grep)?
For example, I want ls -ltra to output as:

<<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file1
<<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file2
<<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file3

instead of:

-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file1
-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file2
-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file3



I tried to do it with a functions which indents it's argument, but it did only for the last line of the output.

Any clues?

Thanks in Advance,
Suddha Satta Ray
  #2 (permalink)  
Old 12-06-2005
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
my_command_here | sed 's/^/ /'

Cheers
Zb
  #3 (permalink)  
Old 12-08-2005
ssray23 ssray23 is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 2
Thanks!!
Works perfectly!!
Sponsored Links
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0