Solved

Search For A File By Fileame on Linux [Don't know the location]

Posted on 2006-06-22
2
302 Views
Last Modified: 2013-12-16
Hi,

I try to search for file by filename on linux, but I don't know where the file is located on the system.
Does any body know any cmd beside "whereis", "find", to find this file, because I think "whereis" and "find" does not search the whole system, and we have it provide a path.

thanks,

Jack

0
Comment
Question by:huabin
  • 2
2 Comments
 
LVL 22

Expert Comment

by:pjedmond
ID: 16964215
find / | grep "filename"

This will search the whole of the filesystem (provided it is run as root), and grep will extract any file which has "filename in its path.

(   (()
(`-' _\
 ''  ''
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 250 total points
ID: 16964236
or:

find / -name filename

or any other variant...Obviously the command has to be run as a user who has permission to read the files.

(   (()
(`-' _\
 ''  ''

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sendmail STARTTLS error 37 84
Using SSH Through A Bastion Host Transparently (Is the topic) 1 45
Virtualizing very old guest OS 4 80
nagios 4 php error after installation 6 78
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now