Buster Beaver Cerakote
Gun Deals
Low Price Guns
J&B Firearm Sales
Advertise on Northwest Firearms
Sporting Systems
Oregon Rifleworks
Oregon Arms & Ammunition
Southwest Firearms Forum
Welcome to Northwest Firearms
Join our community, sign up for free today!
Sign Up

Completely off topic! UNIX!!

Messages
209
Reactions
13
So, I had an assignment for one of my unix class, we've been working on regular expressions. It took me a while, and I finally found a solution for this problem, but I can't help feeling there must be a more elegant and efficient way to do this...

Problem statement:

Display the full file name (including the full path) and file size of all files whose name (excluding the path) is longer than 10 characters.

My ugly solution:

find / . -printf '%p::%s bytes\n' 2> /dev/null | rev | egrep '::[a-Z\.]{10,}' | rev

Any of you fellow computer people have a better way?
 

NEW CLASSIFIED ADS

LATEST REVIEWS

  • Supporting Vendor Copeland Custom Gunworks
    5.00 star(s)
    I had a second gunsmithing job completed by Mr. Copeland. As with the first, he did amazingly good work, communication was solid, and the rates...
    • CountryGent
  • Supporting Vendor Copeland Custom Gunworks
    5.00 star(s)
    I brought Tim a henry goldenboy youth and a vision of what I wanted. Tim made it come true at a very reasonable price, while others quoted me way...
    • Iceman04503
  • Supporting Vendor Copeland Custom Gunworks
    5.00 star(s)
    Tim, has done several projects including a sweet 1911 .38 super project
    • Qochoc
  • Mary's Pistols
    5.00 star(s)
    Fantastic small business with equally excellent folks running the place. I was given fair value for a trade in and was able to order something I...
    • Red98422
  • Gooseneck Road
    4.00 star(s)
    Very popular service road with some unmarked logging roads that branch off of the main. Relatively cleaned up from what we saw. I just wish that...
    • Benzdriver81

SUPPORT NORTHWEST FIREARMS

Staff online