
Look for files in /var/log that have not been modified in the last 3 days:.Find files in /home/pi created less than 60 minutes ago:.-amin: This one is for access time elapsed in minutesįor each of this option, you can specify a threshold, and say if it should be above or that threshold.-mmin: Same thing for the modification minutes.-ctime: Difference in days from the creation date.-cmin: Difference in minutes from the creation date.It works all the same, so I’ll give you all the options at once: The first one is to find files depending on their creation, access or modification date. Well, find has many options to help you in this case. Ok, so the name/iname option is cool, but what if I don’t know the name of the files I’m looking for? The first one is for file ending with “syslog”, the second starting with “syslog” and the last one containing “syslog”. If you also want files containing the word you provide in parameter, you can use stars as wildcard, for example: This is perfect if you know the exact name of a file and want to locate it, but it’s not working if you only have a part of the name. You can remove the path to search in the current directory (recursively), or the options (to display all file), but most of the time you will use both.Īlso, when looking for a file in the whole file system, don’t forget to use sudo to get access to the system files. The find syntax is generally formatted as: I will try to keep this simple, and give you the most useful options only. Unfortunately, many criteria means many options to remember when you try to use it. It’s powerful and will save you most of the time, as you can add many criteria to filter the results you are interested in.

Find Introductionįind is the command that most people will give you when you ask where is my file. Just connect to your Raspberry Pi with SSH, open a session if on a minimal system, or start a terminal on Desktop. I will also give you a bonus tip at the end 🙂īefore going further, if you are really new in the command line, I recommend checking my tutorial on how the Raspberry Pi file system works.Īll the commands listed here can be use on most Linux operating systems. In this post, I’ll explain the command syntax for each one, and give you a few examples, so you can use them correctly. They accept interesting options, to quickly locate any file on the Raspberry Pi file system. I will show you everything in this tutorial.įind, locate and grep are three commands very useful to search for a file on Raspberry Pi.

No worry, you can do everything with a few commands to learn. You will find that npm tasks (as defined in package.json files) are essentially collections of commands line arguments bundled together.On Raspberry Pi OS (especially the lite version), there is no fancy tool to find a file on your SD card. Using npm, git, webpack, gulp etc are all command line based and will help you get comfortable.
#Find file in terminal windows#
When using Finder or Windows Explorer, you can often right-click and see if there is an "Open in Terminal" (or similar) command.įor example, if you have a terminal utility like iTerm2 installed, you will see a "New iTerm Window Here" option or a "New iTerm Tab Here" option when you right-click.


The following will help orientate you on the command line:
