Beruflich Dokumente
Kultur Dokumente
You can use the file manager provided with your Linux distribution to search for files. If you are used
to using Windows then a file manager is akin to Windows Explorer. It contains a user interface with a
series of folders which when clicked show the subfolders within those folders and any files that are
contained within.
Most file managers provide a search feature and a method for filtering the list of files.
The best way to search for files is to use the Linux command line because there are many more
methods available to search for a file than a graphical tool could ever possibly attempt to include.
find /
If however, you want to start searching for the folder you are currently in then you can use the
following syntax:
find .
Generally, when searching you will want to search by name, therefore, to search for a file called
myresume.odt across the whole drive you would use the following syntax:
find / -name myresume.odt
The first part of the find command is obviously the word find.
The second part is where to start searching from
The next part is an expression which determines what to find.
Finally the last part is the name of the thing to find.
The tilde is a metacharacter commonly used for denoting the home folder of the current user.
Expressions
The most common expression you will use is -name.
The -name expression lets you search for the name of a file or folder.
There are however other expressions you can use as follows:
How To Find Files Accessed More Than A Certain Number Of Day Ago
Imagine you want to find all the files within your home folder accessed more than 100 days ago. You
might want to do this if you want to backup and remove old files that you don't access regularly.
In order to do this run the following command:
find ~ -atime 100
Patterns
When you search for a file you can use a pattern. For example, maybe you are searching for all files
with the extension mp3.
You can use the following pattern:
find / -name *.mp3
Summary
The find command is very powerful. This guide has demonstrated how to search for files but there are a
huge number of options available and to understand all of them you should check out the Linux
manual.
You can do this by running the following command in the terminal:
man find