I am looking for files of type .flv
, .avi
, etc
I would like to see a list of all the files (on my server) of those file types (I don't mind doing it one by one, i.e. seeing all the files of .flv
, then all the files of .avi
).
Then, once I identify the ones I want to move, how do I copy several files that are scattered all over the filesystem to a specific folder?
Best Answer
There are several ways to search for files on GNU/Linux systems. The two main ways are
locate
andfind
:locate
uses a database of files known in the whole system to find documents. It is very useful but requires to keep this database up-to-date (withupdatedb
), which can take a long time;find
searches for files in a given directory. It is usually slower thanlocate
(it has no persistent database) but is more fine-tuned.So, if you need to find all files on your system that match your criteria, you can use
locate
:whereas if you're searching in a specific directory and want to make sure to have no cache delay effect, you can use
find
:Now, to copy these files to a specific folder:
or