ls -l column headings


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ls -l column headings
# 1  
Old 08-16-2007
ls -l column headings

I'm trying to see if there's a way to see column headings when I type the

ls -l command.

I know what some of the fields mean for example in the following listing:

Code:
total 136
drwxr-xr-x  2 root root  4096 Jun  5 15:16 bin
drwxr-xr-x  3 root root  4096 Jul  9 15:25 boot
drwxr-xr-x  9 root root  3240 Jul 17 20:08 dev
drwxr-xr-x 40 root root  4096 Aug 14 16:51 etc

the first column is permissions.

I don't know what the 2nd, 3rd and 4th column mean.

man ls , says "-l use a long listing format" but doesn't detail what's listed.

I searched everywhere, but couldn't find an answer to this question.

I appreciate any information on getting the headings to display.
# 2  
Old 08-16-2007
As far as I know, it's impossible to show column headings for the ls command. However, instead of man, try "info ls":

Code:
`-l'
`--format=long'
`--format=verbose'
     In addition to the name of each file, print the file type,
     permissions, number of hard links, owner name, group name, size in
     bytes, and timestamp (by default, the modification time).  For
     files with a time more than six months old or in the future, the
     timestamp contains the year instead of the time of day.  If the
     timestamp contains today's date with the year rather than a time
     of day, the file's time is in the future, which means you probably
     have clock skew problems which may break programs like `make' that
     rely on file times.

     For each directory that is listed, preface the files with a line
     `total BLOCKS', where BLOCKS is the total disk allocation for all
     files in that directory.  The block size currently defaults to 1024
     bytes, but this can be overridden (Note: Block size).  The
     BLOCKS computed counts each hard link separately; this is arguably
     a deficiency.

     The permissions listed are similar to symbolic mode specifications
     (Note: Symbolic Modes).  But `ls' combines multiple bits into the
     third character of each set of permissions as follows:
    `s'
          If the setuid or setgid bit and the corresponding executable
          bit are both set.

    `S'
          If the setuid or setgid bit is set but the corresponding
          executable bit is not set.

    `t'
          If the sticky bit and the other-executable bit are both set.

    `T'
          If the sticky bit is set but the other-executable bit is not
          set.

    `x'
          If the executable bit is set and none of the above apply.

    `-'
          Otherwise.

     Following the permission bits is a single character that specifies
     whether an alternate access method applies to the file.  When that
     character is a space, there is no alternate access method.  When it
     is a printing character (e.g., `+'), then there is such a method.

# 3  
Old 08-17-2007
Thank you robotronic , that is very useful info.
# 4  
Old 08-20-2007
If you issued the ls -l command it will list out the all files and DIR in the root.

ls -l command will display the below result

total 136
drwxr-xr-x 2 root root 4096 Jun 5 15:16 bin
drwxr-xr-x 3 root root 4096 Jul 9 15:25 boot
drwxr-xr-x 9 root root 3240 Jul 17 20:08 dev
drwxr-xr-x 40 root root 4096 Aug 14 16:51 etc

1st column is --> file type(DIR/Files) and access details for UGO (User Group Others).
2nd column is --> position of the file/dir and Name of the Root (2,9)
3rd Column is --> Name of the Root and file located path (root)
4th Column is --> - do-- (i am not sure)
5th Column is Size of the file and Dir (4096 )
6th Column is (Timestamp)Date and time of file / DIR created. (Aug 14 16:51
7th Column is File Directory name (dev,boot)

Let me know if you need any details

Regards,
Siva.P
Bangalore
# 5  
Old 07-21-2008
how to display 2nd coloumn from a file ?
# 6  
Old 07-22-2008
Hi,

If you want display the second column from the file, we can go for awk command

here is the correct command

ls- l | awk '{ print $2 }'

examaple:

ls -l

-rw-r--r-- 1 raroc raroc 0 2007-10-23 16:05 tt
-rw-r--r-- 1 raroc raroc 22 2008-05-09 21:19 web_orig_20070509 -
-rw-r--r-- 1 raroc raroc 23 2008-05-09 21:16 work -

correct command for retrieve the second column

ls- l | awk '{ print $2 }'

O/P is:
1
1
1


Regards,
MPS
# 7  
Old 07-22-2008
Correction to Siva's reply


2nd column is --> Number of links (2,9)
3rd Column is --> File/directory owner (root)
4th Column is --> File/directory group (root)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with awk command on report with headings

Hi all, I have a report that looks like this: ------------------------------------------------- -- AOC - XXXXXXX -- ------------------------------------------------- Thread Last Sequence Received Last Sequence Applied Difference ----------... (12 Replies)
Discussion started by: cougartrace
12 Replies

2. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

3. Shell Programming and Scripting

Remove the headings

HI I am executing faloowing commands. mr batch_1 > my_temp.txt ; mr batch_2 >>my_temp.txt; mr batch_3 >> my_temp.txt; mr batch_4 >> my_temp.txt; and the out put file is as this cat my_temp.txt Machine Name Max Load Current Load Factor O/S Status... (3 Replies)
Discussion started by: ptappeta
3 Replies

4. UNIX for Dummies Questions & Answers

sort by keeping the headings intact?

Hi all, I have a file with 3 columns separated by space. Each column has a heading. I want to sort according to the values in the 2nd column (ascending order). Ex. Name rank direction goory 0.05 --+ laby 0.0006 --- namy 0.31 -+- ....etc. Output should be Name rank direction laby... (3 Replies)
Discussion started by: Unilearn
3 Replies

5. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

6. UNIX for Dummies Questions & Answers

Help needed with adding column headings in syslog report

Hi all, I need your help in adding column headings in the below report. The headings I want are: Count - Host - Message Type The command used to create the report is as follows: for messages in `cat syslog_message_list.txt` do grep $messages syslog.`date +%d%m%y`.log | awk '{print $4 " " "... (4 Replies)
Discussion started by: wthomas
4 Replies

7. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

8. Shell Programming and Scripting

Using sed (or similar) to rename variable headings

Hello, I'm rather new to the world of regular expressions and sed, though am excited by its possibilities. I have a particular task I'd like to achieve, and have googled the topic quite a bit. However, having found some codes that perform a task very similar to what I'd like to do, I can't for... (2 Replies)
Discussion started by: redseventyseven
2 Replies

9. AIX

split a filename and print to 2 different headings

I need help to split a filename 'a0crk_user:A0-B0123$#%test' into a0crk_user and A0-B0123 and print the output under 2 different columns namely User and Status. for eg. the output should like below: User Status ---- ------ a0crk_user A0-B0123 (3 Replies)
Discussion started by: mbak
3 Replies

10. Shell Programming and Scripting

sed or awk to convert text files with recurring headings to rows and colum

I have many text file reports generated by a Information Assurance tool that I need to get into a .CSV format or Excel tab delimited format. I want to use sed or awk to grab all the information in the sample text file below and create column headings:Risk ID, Risk Level, Category, Description, How... (5 Replies)
Discussion started by: Bjoeboo
5 Replies
Login or Register to Ask a Question