LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-03-2002, 01:31 AM   #1
Chooco
Member
 
Registered: May 2002
Location: Mexico
Distribution: Slackware
Posts: 118

Rep: Reputation: 15
can i search for files from the console?


i have always wondered if i could do this. you can open konqueror or whatever and select find file from one of those menus but can i do it from the console? i'm trying to learn Linux through console with xinit up (just learned that ) and i want to find some stuff of mine because i'm really really new to Linux.
so far i have tried "search (file name)" and "find (filename)" but it always says "no such command 'search'" or "no such command 'find'"

is there a command?
 
Old 06-03-2002, 01:46 AM   #2
mimi
Member
 
Registered: Apr 2002
Location: Earth globe
Distribution: Red Hat Linux
Posts: 35

Rep: Reputation: 15
try " man find" it will help you how to use find command.let me give you an example:
>find /tmp -name "*.jpg"

mimi
 
Old 06-03-2002, 01:47 AM   #3
sakeeb
Member
 
Registered: Apr 2002
Posts: 270

Rep: Reputation: 31
You can use "find" command to seach for a file. find program usually locates in /bin or /usr/bin. make sure these are in your PATH

you can also use locate

see >
man locate
man find
 
Old 06-03-2002, 04:20 AM   #4
t_sundaramurthy
LQ Newbie
 
Registered: Jun 2002
Posts: 1

Rep: Reputation: 0
You can use "find" command to seach for a file. find program usually locates in /bin or /usr/bin.

You can use this command like this

find -name <filename>







sundar
 
Old 06-03-2002, 04:30 AM   #5
Chooco
Member
 
Registered: May 2002
Location: Mexico
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 15
ah man i screwed up big time

i type this command in:
[shawn@linux.shawnserver.dhs.org]$ find / *kde*

and it starts rattling off just TONS of stuff, it's still going lol
 
Old 06-03-2002, 07:53 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
If you do something like that again, and it isn't what you wanted you can always type CTRL+c and it will stop whatever it was doing and return you to a prompt.
 
Old 06-03-2002, 08:17 AM   #7
Chooco
Member
 
Registered: May 2002
Location: Mexico
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 15
i think that search crashed my computer. when i returned to it about an hour later, it asked me to log in again.......strange.
 
Old 06-03-2002, 01:53 PM   #8
cannonfodder
LQ Newbie
 
Registered: Mar 2002
Location: Rochester, NY, USA
Distribution: Mandrake 8.2
Posts: 3

Rep: Reputation: 0
The nicest way to find files in the console (fastest) is the locate command mentioned earlier..


su
locate -u <- rebuilds the files database


locate opera

Will locate all instances of files with opera in the file or folder name.

Read the man locate for options such as skipping fat32 volumes or starting locate from a specific path.

You can setup locate to run automatically or manually su and locate -u anytime I tend to do that after I've installed a lot of software and am looking for files.
 
Old 06-04-2002, 03:31 AM   #9
sakeeb
Member
 
Registered: Apr 2002
Posts: 270

Rep: Reputation: 31
Actually the "find file" menu of gnome and kde uses find programs. so you can also use it to find a file in console.

to find a file named foo.c in the subdirectory of /home/sak use

find /home/sak -name foo.c

also you can use wild cards

find /home/sak -name f*.c

for more help see "man foo" and "info foo"
 
Old 06-04-2002, 04:06 AM   #10
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Rep: Reputation: 30
LOL sakeeb. Don't you mean "man find" and "info find" ?
 
Old 06-04-2002, 04:32 AM   #11
sakeeb
Member
 
Registered: Apr 2002
Posts: 270

Rep: Reputation: 31
sorry i meant what did you say

thanx
 
Old 06-04-2002, 08:30 AM   #12
Chooco
Member
 
Registered: May 2002
Location: Mexico
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 15
i wonder if there is one "man boobs"
 
Old 06-04-2002, 08:38 AM   #13
kahuna
Member
 
Registered: Jun 2002
Location: Grand Rapids, MI
Distribution: Redhat, Slackware
Posts: 78

Rep: Reputation: 15
If the program is in your path, you can use the which command, and you will get the full path. Not as useful as find or locate if you do not know if you can execute the program or not, but good if you need to know the full path for scripts.

$which bash
/bin/bash
 
Old 06-04-2002, 12:24 PM   #14
shassouneh
Member
 
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556

Rep: Reputation: 30
how about "man whore"?
LOL everybody. Just kiding. No offense
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
search/replace in many files allelopath Linux - General 1 08-02-2005 09:21 PM
Search for files in Fedora 3 wjal Linux - Newbie 7 05-23-2005 09:51 PM
To search for files of a particular size mufy Linux - General 1 12-09-2004 12:44 AM
Search for Files vs. ls albean Linux - Newbie 2 11-14-2004 02:35 PM
Search all text files? nextekcarl Linux - General 4 10-20-2004 12:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:03 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