LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how can we serch file or folder in linux on command prompt (https://www.linuxquestions.org/questions/linux-server-73/how-can-we-serch-file-or-folder-in-linux-on-command-prompt-887693/)

ganesh24pal@gmail.com 06-22-2011 02:39 AM

how can we serch file or folder in linux on command prompt
 
how can we serch file or folder in linux on command prompt.

Fedora 10.

druuna 06-22-2011 03:50 AM

Hi,
Quote:

Originally Posted by ganesh24pal@gmail.com (Post 4392503)
how can we serch file or folder in linux on command prompt.

Fedora 10.

Have a look at the find and locate commands.

Using find: Example uses of the Linux Command find

Locate is simpler and faster, but it does need an up-to-date database (the updatedb command refreshes the database). Example: locate hosts

Hope this helps.

16pide 06-22-2011 05:08 AM

druuna is right, find is great for finding files or directories. For example:
Code:

find . -name "*xyz*" -print
will find any file or directory with xyz anywhere in the name.

You should however go away from Fedora 10, it is out of support since about 18 month, so does not have recent security fixes, and then is vulnerable for attacks ...
Fedora 15 is the latest one.

hhh123 06-22-2011 11:58 PM

simply use 'locate' command

syntax :- locate <filename>

eg :- # locate httpd.conf
/etc/httpd/conf/httpd.conf

ganesh24pal@gmail.com 06-23-2011 05:10 AM

Quote:

Originally Posted by 16pide (Post 4392581)
druuna is right, find is great for finding files or directories. For example:
Code:

find . -name "*xyz*" -print
will find any file or directory with xyz anywhere in the name.

You should however go away from Fedora 10, it is out of support since about 18 month, so does not have recent security fixes, and then is vulnerable for attacks ...
Fedora 15 is the latest one.

My server is working fedora 15. My IT head now allowing to change.

centos123 06-23-2011 05:43 AM

best command is
locate <filename> and whereis <filename>

it is simple and best

hhh123 06-23-2011 11:20 PM

Quote:

Originally Posted by centos123 (Post 4393607)
best command is
locate <filename> and whereis <filename>

it is simple and best

there is no use this command when you use this "whereis"

itsjust 06-24-2011 10:32 PM

try this tutorial about finding things in linux
finding your way in linux

centos123 06-24-2011 11:39 PM

@hhh123......first you try whereis then say...ok.

this is also used for locating....you cant say there is no use.every command give their individual output.so its on user which one they are adopting.

centos123 06-24-2011 11:42 PM

@hhh123

where is output of "whereis" command

#whereis samba
samba: /etc/samba /usr/lib/samba /usr/share/samba /usr/share/man/man7/samba.7.gz
if u dont know the use of command then don't oppose on rply..ok.remember it.


All times are GMT -5. The time now is 09:43 AM.