LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Command line args..

[ILUG] Command line args..

kevin lyda kevin at suberic.net
Thu Jun 17 15:42:20 IST 1999


"John P. Looney" burst across the net:
> I want to write a little proggie that takes some args, and looks stuff up
>in a database. The idea is that they can do something like:
>
> dbquery --sum size *.wav and *.mp3

db?  what?

find / -name '*.wav' -o -name '*.mp3' -exec wc -c '{}' ';' | awk '{a+=$0} END {print a "\n"}'

that will do the trick.  willing to be a bit out of date?  most linux
boxes have locate:

(locate .wav; locate .mp3)|xargs -n 1 wc -c|awk '{a+=$0} END {print a "\n"}'

> dbquery --list name uid=288 or size \> 10000
>
> and it'll list filenames of files that are owned by user 288, or bigger
>than 10K.

find / -user 288 -o -size +10k

> I'm trying to work out what's a good option syntax for allowing people to
>ask what they want, without it being a headache for me. The idea is to take
>in some options, turn it into SQL, and feed it to the database, and at the
>moment, I'm tempted to say "just give me an SQL string", because any other
>way isn't powerful enough. What things would you ask a filesystem database ?

man find.

kevin




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell