I want to print to the screen a list of all file types *.ext in a folder and its sub_folders
so the list will be something like this
avi
txt
jpg
doc
I want to print to the screen a list of all file types *.ext in a folder and its sub_folders
so the list will be something like this
avi
txt
jpg
doc
What is wrong with good oldYou might also find the tree command useful.Code:~ $ ls
Code:~ $ sudo apt-get install treeCode:~ $ tree
You can get a list of all extensions with the following
First cd to the top directory, it'll then print every unique extension it finds. If a file doesn't have an extension it'll be excluded from the list.Code:find . -type f | sed -e 's/^.*\.\([^\.]*$\)/\1/' -e '/^\//d' | sort -u
Mark your thread as [SOLVED], use Thread Tools on forum page.
Holy crap, even after 10 years Unix usage, I've never seen a command look like that. Well done.
Bookmarks