473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ls - ltr with Heading

AdusumalliGopikumar
Can any one tell me how to get the column heading when we type 'ls -ltr ' to list the files in a particular directory..



Thanks in advance
Sep 29 '08 #1
8 16489
ashitpro
542 Expert 512MB
As far as I know...it is impossible to print the column headers with ls itself..
May be some other soul can help you out in this forum
Sep 29 '08 #2
numberwhun
3,509 Expert Mod 2GB
If you are looking for some kind of header that tells you what each section of the ls -lrt output is, then you are just going to have to keep a print out of it next to you. Its not hard to know what is what. You shouldn't need it if you know what is being output to the screen.

Regards,

Jeff
Sep 29 '08 #3
Nepomuk
3,112 Expert 2GB
I might be misinterpreting your question, but if you just want to print the first line of the output, use this:
Expand|Select|Wrap|Line Numbers
  1. ls -ltr | head -n 1
Greetings,
Nepomuk
Oct 7 '08 #4
I might be misinterpreting your question, but if you just want to print the first line of the output, use this:
Expand|Select|Wrap|Line Numbers
  1. ls -ltr | head -n 1
Greetings,
Nepomuk

No it is giving me a total.
Oct 7 '08 #5
Nepomuk
3,112 Expert 2GB
No it is giving me a total.
Well, that would be the first line of the output. ^^

Greetings,
Nepomuk
Oct 7 '08 #6
Well, that would be the first line of the output. ^^

Greetings,
Nepomuk

That is ok Nepomuk, ls -ltr | head -n 10 will 10 lines ...

but my concern is headings of the columns for 'ls -ltr' ..
like
permissions filename size .. etc
Oct 8 '08 #7
Nepomuk
3,112 Expert 2GB
That is ok Nepomuk, ls -ltr | head -n 10 will 10 lines ...
I know, I do understand what head does, I just didn't quite understand, what it was you wanted.
but my concern is headings of the columns for 'ls -ltr' ..
like
permissions filename size .. etc
Ah, now I understand. Well, I checked the man page and couldn't find anything. There might be something in the coreutils info page (info coreutils -> * Directory listing:: -> * ls invocation::), but I couldn't find anything to solve your problem in there either so far. I guess, you're probably out of luck.

Of course, you could always try to write something like that yourself. (Maybe Perl or Python would be a good choice for this? But I know neither...)

Greetings,
Nepomuk
Oct 8 '08 #8
numberwhun
3,509 Expert Mod 2GB
That I know of, ls does not output the columns at all. 99.9% of the people using unix just know what each column is, so there is no need. If you need to know, then reference the ls man page. Otherwise, you can write a perl script to output headers and then the ls output.

Regards,

Jeff
Oct 9 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Dave Patton | last post by:
http://members.shaw.ca/davepatton/gps.html In another newsgroup(related to GPS), in regards to the above page, someone said:...
2
by: John B. | last post by:
I'm using <h1>MY HEADING</h1> to display a title, however I would like to show one short line of text beside it<p>The short line of text</p>, and then go back to normal. Here's an example of how...
5
by: Chris Reigrut | last post by:
I have a bunch of (old) pages that are outline-driven, and use the h1-h6 elements to define headings. Is there any way that I can create a stylesheet to show them in an indented style? For...
1
by: Larry R Harrison Jr | last post by:
I have Javascript called in HTML which runs a slide show. One thing that the HTML does is it has a "heading" just over the picture that never changes. I'd like to be able to have this heading be...
5
by: Charles Law | last post by:
I have a document in the following style 1 Introduction 2 Next Heading 2.1 Sub-section Some text ... 2.2 Another Sub-section 2.2.1 Getting deeper 3 Another Major Heading...
3
by: dennist685 | last post by:
Format text as a heading I'm progressing through a walkthrough on DetailsView control Early on it says Type Edit Employees, select the text, and then format the text as a heading. I clicked...
5
by: MaxiWheat | last post by:
Hi, I would like to expose a situation that I would like to have informations about. Let's suppose I have a table that looks like this : <table cellspacing="0" cellpadding="0" border ="0">...
1
by: satya.mahesh | last post by:
Hi All, I am working on a problem which "eliminates blank lines in export (between headings and when a heading is empty)". I want a macro which will do this job for me. For e.g: Heading1 ...
4
by: dpratt | last post by:
I have some xml documents that I am converting to html via an xsl transform. This means that the structure of the html can be whatever I want/need it to be. On the other hand, I want the majority...
0
by: xavier.boneu | last post by:
Hi! I beg you to give me a hand on the following issue. I would like to know how could I read the field's heading (not the field name) using standard SQL. I created a new table and each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.