LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-29-2011, 04:01 PM   #1
Belton222
LQ Newbie
 
Registered: Mar 2011
Posts: 13

Rep: Reputation: 0
How do I get ls to print column headings?


I'm writing a script to use output from the ls command, and want column headings to help me - there are so many options in the ls command, with different data being displayed differently that I'm getting confused. Column headings would make it so much easier to understand.

Thanks in advance,
David
 
Old 10-29-2011, 11:01 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
There is no ls option to print column headings; perhaps your script could add them. AFAIK there is no complete reference to the meaning of GNU ls columns. The nearest thing to it is this page for a UNIX ls; perhaps you could create a page for GNU ls.
 
Old 10-30-2011, 01:13 AM   #3
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by Belton222 View Post
I'm writing a script to use output from the ls command
It's probably not a good idea, especially if you want your script to be portable. Not every implementation of ls works the same. Whatever it is you're trying to do, there is very likely a much better solution.

http://mywiki.wooledge.org/ParsingLs
 
  


Reply


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
awk print word on each line on 3 column mad_penguin Programming 9 09-22-2011 05:59 AM
assigning column name to awk print in a loop bashprog Programming 5 09-29-2010 01:54 AM
[SOLVED] search a string and print column vikas027 Programming 6 03-14-2010 09:20 AM
sed / awk command to print line number as column? johnpaulodonnell Linux - Newbie 2 01-22-2007 07:07 AM
Numbered headings in XHTML vharishankar Programming 6 08-07-2005 01:12 AM


All times are GMT -5. The time now is 07:36 PM.

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