Wednesday, December 14, 2011

Search for a file from terminal in Linux

To day I just came across a situation in which I have to search for a file/ folder but i don't know the path and full name. So, in these situations geenrally we go with search. But what if you have only terminal. I experimented this in CentOS 4.4 (Linux) and got perfect results. Command is as below.

Find all files with something in their name
find . -name "*.txt"

Find all files that belong to a certain user
find . -user ravi

Find only directories, files, links, or sockets
find . -type d

Find things over a megabyte in size
find ~/Movies/ -size +1024M

Find all files in my directory with open permissions
find ~ -perm 777

Combinations are also accepted.

[via]If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

No comments:
Write comments