Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-31-2005, 10:49 PM   #1
Registered: Feb 2003
Posts: 159

Rep: Reputation: 30
Search and Size

I am trying to search for files and give me the total size for the files found. This is what I have tried and what I have gotten.

find *.jpg /var/www/html/albums/ | grep du -ac
find: *.jpg: No such file or directory

if I run just the find command as such, find *.jpg /var/www/html/albums/, i get all the pictures just find.

I also tried this...

[root@Sun root]# du -c /var/www/html/albums/*.jpg
du: `/var/www/html/albums/*.jpg': No such file or directory
0 total

It doesn't like the *jpg. I believe this is cause it's only looking in the albums dir, and the pictures are are in dirs under that.
Old 08-31-2005, 11:17 PM   #2
Registered: Feb 2003
Posts: 159

Original Poster
Rep: Reputation: 30
I came across this command(s). It appears to be working, but if somebody could verify.
[root@Sun albums]# find /var/www/html/albums/ -type f -path *.jpg |xargs du -shc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
search default: search post title only slackie1000 LQ Suggestions & Feedback 4 03-10-2005 08:50 AM
To search for files of a particular size mufy Linux - General 1 12-09-2004 01:44 AM
search for files based on file size fatrandy13 Linux - General 1 12-05-2004 11:47 PM
Size of search engines the_imax General 3 08-08-2004 01:45 AM
Quick VIM question (unhighlighting search terms after search) lrt2003 Linux - Newbie 5 05-08-2004 06:21 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration