Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-29-2011, 05:01 PM   #1
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,
Old 10-30-2011, 12:01 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
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, 02:13 AM   #3
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
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.


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

All times are GMT -5. The time now is 08:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration