How To Find Path Of a File In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Use the ‘find’ command: This is perhaps the most common and easiest way to find the path of a file in Linux. The ‘find’ command allows you to specify what you are looking for and where you should look for it. For example, if you want to find the path of a file named ‘file’ in the current directory you can use the command: find .
–name file
2. Use the ‘pwd’ command: This command lists the full path of the current working directory. If the file you are searching for is located in the current working directory you can use the command to find its path.
3. Use the ‘which’ command: This command is used to locate the executable file associated with a given command name. You can use it to find the path of a given file. For example, if you want to find the path of a file named ‘file’ you can use the command:
which file