Is it possible to write something in the terminal in some way
so that you get a list of all different file extensions that a hard drive contains
and how many of each kind ??
Example of possible result:
*.jpg 123456 files total
*.gif 54321 files total
and so on...
File extension statistics ?
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
File extension statistics ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: File extension statistics ?
Code: Select all
$ find -iname "*.jpg" | wc
15101 15147 696695
Code: Select all
man wc
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: File extension statistics ?
My understanding:Flemur wrote: ⤴Sun Feb 17, 2019 2:49 pm15101 is the number of .jpg files. Dunno what the others are, tryCode: Select all
$ find -iname "*.jpg" | wc 15101 15147 696695
Code: Select all
man wc
15101 is the number of lines (the total number of matching filenames)
15147 is the number of words (you have a few jpegs with spaces in their names)
696695 is the number of characters (bytes) returned
Re: File extension statistics ?
Sounds right - I never knowingly use delimiters in file names, so got curious and it turned out they were in a "Deep Art Effects" directory copied from a phone.
Edit: OP, notes on this comamnd:
find -iname "*.jpg" | wc
"iname" = find by name, i = ignore case (finds JPG, jPG, etc)
"*.jpg" = files which end in .jpg. Use the quotes so "*.jpg" doesn't get expanded, e.g. if you ran
Code: Select all
find -iname *.jpg
Code: Select all
find -iname fred.jpg
To see the difference, go to a directory with some jpg files and enter
Code: Select all
echo *.jpg
echo "*.jpg"
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: File extension statistics ?
File extensions don't mean much in Linux, but sure.
Perhaps a command like this:
This finds all files in the current directory and prints their name, ignores any files that start with a dot, prints the extensions of the remaining files, sorts those extensions, counts each unique extensions and finally sorts on the results such that the extensions are shown from lease frequent to most frequent.
Running that command from your home directory shouldn't take seconds. Running it on your entire filesystem (from / directory) will take a bit.
Perhaps a command like this:
find . -type f -printf '%f\n' | grep '^[^.].*\.' | awk -F. '{print $NF}' | sort | uniq -c | sort -n
This finds all files in the current directory and prints their name, ignores any files that start with a dot, prints the extensions of the remaining files, sorts those extensions, counts each unique extensions and finally sorts on the results such that the extensions are shown from lease frequent to most frequent.
Running that command from your home directory shouldn't take seconds. Running it on your entire filesystem (from / directory) will take a bit.
[SOLVED]Re: File extension statistics ?
I am deeply impressed! I come closer and closer to a "salvation"
and I realize with fear that so many others on this earth have been so misled by this troll that Pyttemjuk sold into us.
Perhaps one can now go one step to find a program or otherwise use the time / date
information contained in the EXIF data contained in each image (JPEG) (RAW)
and use this date to sort images into Chronological order ? Someone who knows something about this ???
and I realize with fear that so many others on this earth have been so misled by this troll that Pyttemjuk sold into us.
Perhaps one can now go one step to find a program or otherwise use the time / date
information contained in the EXIF data contained in each image (JPEG) (RAW)
and use this date to sort images into Chronological order ? Someone who knows something about this ???