LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 09: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, 09:21 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
find $HOME -name "*.jpg" | wc -l
 
Old 05-03-2010, 09: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, 10: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration