Help answer threads with 0 replies.
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 05-03-2010, 10:08 PM   #1
Registered: Feb 2007
Distribution: Ubuntu 10.04
Posts: 281

Rep: Reputation: 31
Bash command to count files ?

Can you help me please?

I would like to count all the jpgs in my home folder

I need a command like this:

~$ Sudo count -R /*/*.jpg

Old 05-03-2010, 10:21 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
find $HOME -name "*.jpg" | wc -l
Old 05-03-2010, 10:44 PM   #3
Registered: Feb 2007
Distribution: Ubuntu 10.04
Posts: 281

Original Poster
Rep: Reputation: 31
Thanks for your interest.

nnjond@nnjond-desktop:~$ HOME -nnjond "*.jpg" | wc -l
HOME: command not found

Old 05-03-2010, 11:34 PM   #4
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
You missed the first word of AlucardZero's command: the find command. Have a second and closer look at that reply.


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
Bash script to find newest files and count them buee Programming 1 02-25-2010 07:43 PM
Count files in dir then move that many files in a script? chuckycharms Linux - Newbie 3 12-18-2009 12:31 PM
Find/grep/wc command to find matching files, print filename and word count dbasch Linux - Newbie 10 09-14-2009 06:55 PM
[SOLVED] bash command or sript to list files sepi Linux - Software 7 08-25-2009 05:15 PM
bash command to count particular character in a string kkpal Linux - Newbie 5 05-27-2008 07:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:19 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