Sponsored Content
Full Discussion: ls -l column headings
Top Forums UNIX for Dummies Questions & Answers ls -l column headings Post 302132369 by robotronic on Thursday 16th of August 2007 03:03:43 PM
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.

 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
ls(1B)																	    ls(1B)

NAME
ls - list the contents of a directory SYNOPSIS
/usr/ucb/ls [-aAcCdfFgilLqrRstu1] file... For each filename that is a directory, ls lists the contents of the directory; for each filename that is a file, ls repeats its name and any other information requested. By default, the output is sorted alphabetically. When no argument is given, the current directory is listed. When several arguments are given, the arguments are first sorted appropriately, but file arguments are processed before directories and their contents. Permissions Field The mode printed under the -l option contains 10 characters interpreted as follows. If the first character is: d Entry is a directory. D Entry is a door. b Entry is a block-type special file. c Entry is a character-type special file. l Entry is a symbolic link. p Entry is a FIFO (also known as "named pipe") special file. s Entry is an AF_UNIX address family socket. - Entry is a plain file. The next 9 characters are interpreted as three sets of three bits each. The first set refers to owner permissions; the next refers to per- missions to others in the same user-group; and the last refers to all others. Within each set, the three characters indicate permission respectively to read, to write, or to execute the file as a program. For a directory, "execute" permission is interpreted to mean permis- sion to search the directory. The permissions are indicated as follows: r The file is readable. w The file is writable. x The file is executable. - The indicated permission is not granted. The group-execute permission character is given as s if the file has the set-group-id bit set; likewise the owner-execute permission char- acter is given as s if the file has the set-user-id bit set. The last character of the mode (normally x or `-') is true if the 1000 bit of the mode is on. See chmod(1) for the meaning of this mode. The indications of set-ID and 1000 bits of the mode are capitalized (S and T, respectively) if the corresponding execute permission is not set. A plus sign (+) appended to the list of permissions indicates that an ACL is associated with the file. When the sizes of the files in a directory are listed, a total count of blocks, including indirect blocks, is printed. The following options are supported: -a Lists all entries; in the absence of this option, entries whose names begin with a `.' are not listed (except for the privileged user, for whom ls normally prints even files that begin with a `.'). -A Same as -a, except that `.' and `..' are not listed. -c Uses time of last edit (or last mode change) for sorting or printing. -C Forces multi-column output, with entries sorted down the columns; for ls, this is the default when output is to a terminal. -d If argument is a directory, lists only its name (not its contents); often used with -l to get the status of a directory. -f Forces each argument to be interpreted as a directory and lists the name found in each slot. This option turns off -l, -t, -s, and -r, and turns on -a; the order is the order in which entries appear in the directory. -F Marks directories with a trailing slash (/), doors with a trailing greater-than sign (>), executable files with a trailing aster- isk (*), FIFOs with a trailing vertical bar (|), symbolic links with a trailing at-sign (@), and AF_UNIX address family sockets with a trailing equals sign (=). -g For ls, shows the group ownership of the file in a long output. -i For each file, prints the i-node number in the first column of the report. -l Lists in long format, giving mode, ACL indication, number of links, owner, size in bytes, and time of last modification for each file. If the file is a special file the size field will instead contain the major and minor device numbers. If the time of last modification is greater than six months ago, it is shown in the format `month date year'; files modified within six months show `month date time'. If the file is a symbolic link, the pathname of the linked-to file is printed preceded by `-->'. -L If argument is a symbolic link, lists the file or directory the link references rather than the link itself. -q Displays non-graphic characters in filenames as the character ?; for ls, this is the default when output is to a terminal. -r Reverses the order of sort to get reverse alphabetic or oldest first as appropriate. -R Recursively lists subdirectories encountered. -s Indicate the total number of file system blocks consumed by each file displayed. -t Sorts by time modified (latest first) instead of by name. -u Uses time of last access instead of last modification for sorting (with the -t option) and/or printing (with the -l option). -1 Forces one entry per line output format; this is the default when output is not to a terminal. The following operand is supported: file A path name of a file to be listed. If the file specified is not found, a diagnostic message is output on standard error. See largefile(5) for the description of the behavior of ls when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). /etc/group to get group ID for `ls -g' /etc/passwd to get user IDs for `ls -l' and `ls -o' See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ ls(1), attributes(5), largefile(5) NEWLINE and TAB are considered printing characters in filenames. The output device is assumed to be 80 columns wide. The option setting based on whether the output is a teletype is undesirable as `ls -s' is much different than `ls -s | lpr'. On the other hand, not doing this setting would make old shell scripts which used ls almost certain losers. Unprintable characters in file names can confuse the columnar output options. 5 May 2005 ls(1B)
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy