Count total image in directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Count total image in directory
# 1  
Old 06-20-2014
Count total image in directory

Dear all,

I have a directory consisted of files in .jpg, .jpeg etc..all of them are image

Code:
20140411030143_62811159403_92886.jpg    5/11/2014 15:01    197K
20140415024737_62811618747_116460.jpg    4/15/2014 14:47    17K
20140415031003_62811618747_109192.jpg    4/17/2014 15:10    17K
20140415051411_6282113867071_22290.jpg    4/15/2014 17:14    8.6K
20140415090029_628118504524_33578.jpg    4/15/2014 9:00    223K
20140415090218_628118504524_73689.jpg    4/19/2014 9:02    223K
20140415094439_62811636636_63535.jpeg    4/15/2014 9:44    128K

I need to count sum of files by date

expected output should be
Code:
4/15/14    4
4/17/14    1
4/19/14    1
5/11/14    1

thanks

Last edited by radius; 06-20-2014 at 10:12 AM..
# 2  
Old 06-20-2014
Thoughts?

What have you tried to do this?
# 3  
Old 06-20-2014
One possible approach...

Code:
$ cat sample40.txt
20140411030143_62811159403_92886.jpg    5/11/2014 15:01    197K
20140415024737_62811618747_116460.jpg    4/15/2014 14:47    17K
20140415031003_62811618747_109192.jpg    4/17/2014 15:10    17K
20140415051411_6282113867071_22290.jpg    4/15/2014 17:14    8.6K
20140415090029_628118504524_33578.jpg    4/15/2014 9:00    223K
20140415090218_628118504524_73689.jpg    4/19/2014 9:02    223K
20140415094439_62811636636_63535.jpeg    4/15/2014 9:44    128K

$ cat sample40.txt | cut -d" " -f5 | sort | uniq -c
      4 4/15/2014
      1 4/17/2014
      1 4/19/2014
      1 5/11/2014

# 4  
Old 06-21-2014
Code:
awk '{print $2}' file | sort -b | uniq -c | awk '{print $2,$1}'

# 5  
Old 06-21-2014
Code:
awk '{T[$2]++} END{for(i in T) print i, T[i]}' file

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Total record count of all the file present in a directory

Hi All , We need one help on the below requirement.We have multiple pipe delimited .txt file(around 100 .txt files) present on one directory.We need the total record count of all the files present in that directory without header.File format as below : ... (8 Replies)
Discussion started by: STCET22
8 Replies

2. Shell Programming and Scripting

Count total duplicates

Hi all, I have found another post threads talking about count duplicate lines, but I am interested in obtain the total number of duplicates. For example: #file.txt a1 a2 a1 a3 a1 a2 a4 a5 #out 3 (lines are duplicates) Thank you! (12 Replies)
Discussion started by: mikloz
12 Replies

3. UNIX for Dummies Questions & Answers

In ls -l remove total count

Hi All, When i give ls -ltr i get 'total 10' like this along with files long listing. is there any option in ls command to remove this line or do we need use head -1 command only. $ls -ltr total 45 -rw-r--r-- 1 abc g1 0 Jul 17 07:20 0 -rw-r--r-- 1 abc g1 744 May 9 12:10 a -rw-r--r--... (1 Reply)
Discussion started by: HemaV
1 Replies

4. Shell Programming and Scripting

Finding total count of a word.

i want to find the no:of occurrences of a word in a file cat 1.txt unix script unix script unix script unix script unix script unix script unix script unix script unix unix script unix script unix script now i want to find , how many times 'unix' was occurred please help me thanks... (6 Replies)
Discussion started by: mahesh1987
6 Replies

5. Shell Programming and Scripting

total count of a word in the files

Hi Friends, Need help regarding counting the word "friend" in files test1.txt and test2.txt. ( there is no gap/space between word ) cat test1.txt himynameisrajandiamfriendofrajeshfriend wouldyouliketobemyfriend. cat test2.txt himynameisdostandiamfriendofdostfriend... (2 Replies)
Discussion started by: forroughuse
2 Replies

6. Shell Programming and Scripting

Total Count using AWK

Hi Everybody, I have the following example file... 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1 199|TST-GURGAON|GURGAON|1... (8 Replies)
Discussion started by: sraj142
8 Replies

7. Shell Programming and Scripting

perl script on how to count the total number of lines of all the files under a directory

how to count the total number of lines of all the files under a directory using perl script.. I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this. (5 Replies)
Discussion started by: adityam
5 Replies

8. Shell Programming and Scripting

Bogus Total count

I have a shell script that I am pulling different zip file packages and totaling how many of each type of package is in the directory. I get a bogus total count of one in the middle of my output file (highlighted in RED) and not sure why, also would like to get a grand total of all files but not... (2 Replies)
Discussion started by: freddie999
2 Replies

9. UNIX for Advanced & Expert Users

total count of inodes in a mount

is there Any command to get total count and number of free inodes on a mount. please help (5 Replies)
Discussion started by: pharos467
5 Replies
Login or Register to Ask a Question