How To Find Files With Linux Shell Command Locating File By Name Look Search

Forums » Linux Systems » How To Find Files With Linux Shell Command Locating File By Name Look Search
This Page Contains information about How To Find Files With Linux Shell Command Locating File By Name Look Search By linux with 1 Replies. Last Upated: Thu Apr 24, 2014
lets say i have a file called my_users which is located in several of your directories. all files can be located using find in linux.

locating files by name: make sure you are in the directory or home directory where you want to look for the file name. if you are not sure where you have it, you can always do it from the root directory, but it will be faster if you go to the directory where you think you have the file. so lets say i think my_users file is located somewhere in my home directory and my username is wallpaperama i would use this command
code
cd /home/wallpaperama


once i have chaned to my home directory, i can search for my_users file with this command

code
find ~ -name my_users -print


the find utiltity may take some time to complete its work. as find is examining directories, it reports to your workstation both its output and any error information that is apporpiate. you may see the pathnames of files named my_users as well as information about which directories you cannot examine because of their assinged permissions.

following are explanations of each part of the ocmmand line inthe example command above
( find ~ -name my_users -print )

COMMAND DESCRIPTION
findinstructs the shell to execute the find utility, which searches a target directory and all of its sbudirectories.
~this argument specifies the starting point directory - in this case, your home direcotyr. the resul is a seach of all directories listed i nyour home direcotyr, which includes your home direcotry and all its subdirectories
-name my_users instructs find to locate all files with the specified name my_users. in addition to locating files by name, find can also locate based on the criteria of age, owner , permission, size, tec.
-printspecifies that the full pathname of each occurence of the files matching the selection criterion should be oupt. in addition to pringint, find can be instructed to remove located files, change file permisions, or emply essentially any shell file-manipulation command
ashraf
Title: How To Find Files With Linux Shell Command Locating File By Name Look Search [2905]
Tags: how to find files with linux shell command locating file by name look search