bugGNU Core Utilities - Bugs: bug #18927, feature request: user defined...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18927: feature request: user defined format for ls output

Submitted by:  Rodolfo Borges <barrett9h>
Submitted on:  Thu 01 Feb 2007 01:30:57 PM UTC  
Votes:  8  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 08 Mar 2008 09:51:25 AM UTC, comment #5:

Thanks for the suggestion, but I don't want to encumber ls with such a feature.

Jim Meyering <meyering>
Project Administrator
Sat 25 Aug 2007 12:06:20 PM UTC, comment #4:

My experience with find -printf format letters (and I'm sure of the coreutils developers with command-line option letters) is that there just aren't enough letters. The ones you end up with still available just aren't mnemonic for a new use you have in mind anyway. If you want to implement this feature (and I'm kind of neutral on the idea) I would strongly recommend using words as templating tokens. Perhaps a little like Python does it:

"%(inode)s %(typeletter)s %(symbolicmode)s %(st_nlinks)d %10(owner)s...\n"

Here the item in parentheses is a symbolic name for the thing to be formatted, and the other stuff determines the width of the field and how the data is to be formatted, as usual.

Of course there is a good argument that since find already has most of this functionality, the simplest path is to add the remaining required funcitonality to find.

James Youngman <jay>
Sat 25 Aug 2007 01:50:04 AM UTC, comment #3:

Nor colorizing the output, print sizes in human-readable format, etc, etc.

find != ls

Rodolfo Borges <barrett9h>
Thu 22 Feb 2007 06:16:27 PM UTC, comment #2:

GNU find doesn't have any way of printing "foo -> bar" when foo is a symbolic link to bar, though.

James Youngman <jay>
Thu 01 Feb 2007 01:35:30 PM UTC, comment #1:

find -printf "..." has everything you need.

Andreas Schwab <schwab>
Thu 01 Feb 2007 01:30:57 PM UTC, original submission:

ls --format="${FORMAT_STRING}"

FORMAT_STRING is something like:
%u = owner
%g = group
%s = file size
%f = file name
%m = permission bits (mode)
etc.

Maybe a special char to designate a column separator, so the user can join fields (eg. "%u,%g").

Rodolfo Borges <barrett9h>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by meyering (Posted a comment)
  • -unavailable- added by rwp (Updated the item)
  • -unavailable- added by jay (Posted a comment)
  • -unavailable- added by schwab (Posted a comment)
  • -unavailable- added by barrett9h (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 8 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Mar 2008 09:51:58 AM UTCmeyeringOpen/ClosedOpen=>Closed
    Sat 08 Mar 2008 09:51:25 AM UTCmeyeringStatusNone=>Wont Fix
    Sat 25 Aug 2007 08:51:37 AM UTCrwpSeverity3 - Normal=>1 - Wish
    Sat 25 Aug 2007 01:51:03 AM UTCbarrett9hCarbon-Copy-=>Added barrett9h

    Back to the top


    Powered by Savane 3.1-cleanup1