J&B Firearm Sales
Southwest Firearms Forum
Buster Beaver Cerakote
Oregon Rifleworks
Sporting Systems
Defensive Arts
Advertise on Northwest Firearms
Low Price Guns
Gun Deals
Oregon Arms & Ammunition

Completely off topic! UNIX!!

Messages
209
Reactions
15
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?
 

UPCOMING EVENTS

Arms Collectors of SW Washington Gun Show
Battleground Community Center
912 E Main St, Battle Ground, WA 98604, USA
Cerberus Training Group - Skill Builder - April 25-26th
Cerberus Training Group
47 Cattle Dr, Goldendale, WA 98620, USA

LATEST RESOURCE REVIEWS

  • Idaho Arms and Ammo
    5.00 star(s)
    Picked up a Ruger revolver last year from there. Works good. Staff listened to what I was looking for and showed alternatives, but didn't try to...
    • Zathras
  • SafeFire Indoor Shooting Range & Retail
    5.00 star(s)
    I enjoy this local indoor range, they have lots of fun guns to rent and try out. They also have a gun store if you want to purchase something.
    • wa2020
  • Adaptive Firing Solutions
    5.00 star(s)
    Steve is a great guy to work with! I have had several transactions with him and will continue to do business with him. He is my go to dealer!
    • hker71
  • Straight Shooter Supply
    1.00 star(s)
    A relative of mine recently went through this place to purchase a handgun. They were rude to her, lied to her, and must be new to this FFL stuff...
    • FullMetalJerk
  • Adaptive Firing Solutions
    5.00 star(s)
    Steve is great. Easy to deal with, super low prices on his transfers.
    • DizzyJ

SUPPORT NORTHWEST FIREARMS