JavaScript is disabled
Our website requires JavaScript to function properly. For a better experience, please enable JavaScript in your browser settings before proceeding.
Messages
209
Reactions
22
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

Centralia Gun Show
Centralia, WA
Klamath Falls gun show
Klamath Falls, OR
Oregon Arms Collectors April 2024 Gun Show
Portland, OR
Albany Gun Show
Albany, OR

New Resource Reviews

New Classified Ads

Back Top