LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-03-2010, 10:08 PM   #1
nnjond
Member
 
Registered: Feb 2007
Distribution: Ubuntu 10.04
Posts: 281

Rep: Reputation: 31
Bash command to count files ?


Hi,
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

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

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
find $HOME -name "*.jpg" | wc -l
 
Old 05-03-2010, 10:44 PM   #3
nnjond
Member
 
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
0
nnjond@nnjond-desktop:~$


???
 
Old 05-03-2010, 11:34 PM   #4
penguiniator
Member
 
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.
 
  


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


All times are GMT -5. The time now is 09:47 AM.

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