LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-22-2011, 02:39 AM   #1
ganesh24pal@gmail.com
Member
 
Registered: Jun 2010
Location: Mumbai, India
Distribution: CentOS , Fedora, Open Suse
Posts: 193
Blog Entries: 5

Rep: Reputation: 3
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.
 
Old 06-22-2011, 03:50 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by ganesh24pal@gmail.com View Post
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.
 
Old 06-22-2011, 05:08 AM   #3
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
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.
 
Old 06-22-2011, 11:58 PM   #4
hhh123
Member
 
Registered: Jul 2009
Location: /
Distribution: centos
Posts: 47

Rep: Reputation: 1
simply use 'locate' command

syntax :- locate <filename>

eg :- # locate httpd.conf
/etc/httpd/conf/httpd.conf
 
Old 06-23-2011, 05:10 AM   #5
ganesh24pal@gmail.com
Member
 
Registered: Jun 2010
Location: Mumbai, India
Distribution: CentOS , Fedora, Open Suse
Posts: 193

Original Poster
Blog Entries: 5

Rep: Reputation: 3
Quote:
Originally Posted by 16pide View Post
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.
 
Old 06-23-2011, 05:43 AM   #6
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
best command is
locate <filename> and whereis <filename>

it is simple and best
 
Old 06-23-2011, 11:20 PM   #7
hhh123
Member
 
Registered: Jul 2009
Location: /
Distribution: centos
Posts: 47

Rep: Reputation: 1
Quote:
Originally Posted by centos123 View Post
best command is
locate <filename> and whereis <filename>

it is simple and best
there is no use this command when you use this "whereis"
 
0 members found this post helpful.
Old 06-24-2011, 10:32 PM   #8
itsjust
LQ Newbie
 
Registered: Mar 2010
Posts: 2

Rep: Reputation: 0
try this tutorial about finding things in linux
finding your way in linux
 
Old 06-24-2011, 11:39 PM   #9
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
@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.
 
Old 06-24-2011, 11:42 PM   #10
centos123
Member
 
Registered: Apr 2011
Posts: 397

Rep: Reputation: 16
@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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file conversion command? the same command on all files in a folder ? pete2222 Linux - General 6 10-02-2010 11:59 AM
'file' command for Windows/command prompt? SlowCoder General 4 06-16-2009 08:11 AM
how can we install firefox-3.0.5.tar.bz2 file in linux at command prompt rajesh.dangi82 Linux - Newbie 4 01-17-2009 12:42 AM
execute php file on command prompt robberttheman Linux - Newbie 0 09-23-2004 01:24 PM
How to check the size of a folder from command prompt skoivisto Linux - General 2 07-31-2004 02:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration