Tip: Using find Command in Linux
2009-12-10
278 words
2 mins read
Ok this I was planning for quite sometime.. but found this <a href="http://www.pinoytux.com/linux/tip-using-find-command-in-linux" target="_blank">here. Worth reading for people who want to start off using find command.
Doing command-line stuff in Linux is fun. It may be intimidating for some at first, now that we are in the age where GUI is no longer an option. But with CLI, we can do so many things that can be accomplished faster if we know how to utilize the features of a certain command.
One command that is very flexible is find. With find, you can search not only based on filenames, you can also use other identifiers like GUI and UID, timestamps and file types.
Here are some examples of find commands:
This command will find all files in /home directory with .doc as extension and was modified 24 hours ago:
1
|
This one will find the same files, but not directories, and delete them using -exec option (great for disk usage maintenance, but BACKUP first!):
1
|
You can also find files owned by a certain UID:
1
|
Or by GID:
1
|
You can also search for files and directories with certain permissions:
1
|
And from those examples, you can build your own command to find what you are looking for.
Related Articles:
- 2009/12/08 One click install for Linux systems.
- 2009/12/08 Pipeing linux commands and their output
- 2009/11/25 Linux Installation Guide
- 2009/11/22 Some good and nice open source books worth downloading.
- 2009/11/21 5 Sites To Find Free Alternatives To Popular Software
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.