Looking for:
Manual find linuxManual find linux.35 Practical Examples of Linux Find Command
man - How to search the whole manual pages on Linux? - Unix & Linux Stack Exchange.35 Practical Examples of Linux Find Command
In a recent Opensource. And since everything is a file, you will get a lot of output to sort through. This probably doesn't help you find what you're looking for. You can change the path argument to narrow things down a bit, but it's still not really any more helpful than using the ls command.
So you need to think about what you're trying to locate. Perhaps you want to find all the JPEG files in your home directory. The -name argument allows you to restrict your results to files that match the given pattern. But wait!
What if some of them have an uppercase extension? But the 8. Some of the pictures might have a. Fortunately, we can combine patterns with an "or," represented by -o.
We're getting closer. But what if you have some directories that end in jpg? Why you named a directory bucketofjpg instead of pictures is beyond me.
We can modify our command with the -type argument to look only for files. It turns out you've been taking a lot of pictures lately, so let's narrow this down to files that have changed in the last week. You can do time filters based on file status change time ctime , modification time mtime , or access time atime. These are in days, so if you want finer-grained control, you can express it in minutes instead cmin , mmin , and amin , respectively.
But maybe you don't care about your pictures. Maybe you're running out of disk space, so you want to find all the gigantic let's define that as "greater than 1 gigabyte" files in the log directory:. You can also look for files based on permissions. Perhaps you want to find all the world-readable files in your home directory to make sure you're not oversharing. This post only scratches the surface of what find can do. Combining tests with Boolean logic can give you incredible flexibility to find exactly the files you're looking for.
And with arguments like -exec or -delete , you can have find take action on what it Have any favorite find expressions? Share them in the comments! What is an open decision? Resources What is open source? With the right arguments, the FIND command is a powerful and flexible way to locate data on your system. Register or Login to like. Image by: Opensource. At a minimum, find takes a path to find things. Our latest Linux articles.
What to read next. Ben Cotton. Ben Cotton is a meteorologist by training, but weather makes a great hobby. He co-founded a local open source meetup group, and is a member of the Open Source Initiative and a supporter of Software Freedom Conservancy. More about me. Related Content. How Linux rescued precious audio files with FFmpeg. Reflecting on my first Linux conference. Enter the full URL to your Mastodon profile:. Subscribe to our weekly newsletter. Privacy Statement.
Comments
Post a Comment