• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dumb Q
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dumb Q


  • Subject: Re: Dumb Q
  • From: Marco Masser <email@hidden>
  • Date: Thu, 7 Aug 2008 01:12:39 +0200

I want to make a simple filter that takes the output of "ls -la" and reformats it to appear more like the MS-DOS directory listing. So, I would do something like "ls -la | mydosfilter" and get a directory listing with the filename first, the # bytes second, then the timestamp (leaving out everything from the UNIX permissions bits to the group, and rearranging the rest.)

Why don't you simply add an alias named "dir" to a global bashrc file that translates to something like this: ls -la | awk '{ print $9"\t \t"$5"\t"$6,$7,$8 }'
This simply outputs the file name, two tabs, the size in bytes, a tab and then the date & time. I'm no awk expert, maybe this could be done prettier.


Marco
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Dumb Q (From: William Squires <email@hidden>)

  • Prev by Date: Re: [Newbie] Extracting a specific character number from a string
  • Next by Date: Re: Rotate NSString... I give up :(
  • Previous by thread: Re: Dumb Q
  • Next by thread: remove elements during the iteration on NSMutableDictionary
  • Index(es):
    • Date
    • Thread