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

Submitter:  Rodolfo Borges <barrett9h>
Submitted:  Thu 01 Feb 2007 01:30:57 PM UTC
Votes: 8
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 8 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-03-08 meyering Open/ClosedOpen Closed
    2008-03-08 meyering StatusNone Wont Fix
    2007-08-25 rwp Severity3 - Normal 1 - Wish
    2007-08-25 barrett9h Carbon-Copy- Added barrett9h

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code