LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2015, 10:24 AM   #1
melissa2015
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Rep: Reputation: Disabled
Talking How to Find Files on Linux With 3 Easy Commands


Hi everyone! I have found this post (below) about how to find files on Linux, but I wanted to know if there are any other techniques that will work? Thanks in advance.

http://www.makeuseof.com/tag/3-examp...d-files-linux/
 
Old 03-24-2015, 10:27 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,520

Rep: Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106
Techniques that will work for what? What are you trying to do, exactly, that which/locate/find can't handle it?
 
Old 03-24-2015, 11:16 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Welcome to LQ!

melissa2015

Have a nice time.
 
Old 03-24-2015, 12:40 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,613
Blog Entries: 12

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
Welcome to LQ. Those are great fundamental commands which(1) will help you locate(1) whereis(1) there are files you intend to find(1)

Also the links lead to linux.die.net which I find is a great resource for commands and library function references.

Other stuff as you likely have already experienced are: cd, ls, grep, pwd, man.

You may want to just look up "Linux command line" references via web search and browse some of the advice and tips.
 
Old 03-24-2015, 12:57 PM   #5
Toroso
Member
 
Registered: Mar 2015
Distribution: Mint Linux 17.1 64 Xfce
Posts: 31

Rep: Reputation: 4
Thanks for the tipz!
 
Old 03-25-2015, 08:57 AM   #6
melissa2015
LQ Newbie
 
Registered: Mar 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks for the tips. linux.die.net is something I didn't know anything about but looks like a great resource.
 
Old 03-26-2015, 05:24 AM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,062

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
Broadly speaking
  • locate is dumb, but quick and fuss free
  • find is cleverer, can do tricks that locate couldn't even think of, but has a, err, learning curve, and can be more fussy; is also slow if you are using it on a big disk volume

The other basic point that I'd make, that isn't covered in the article, is that locate often turns up all sorts of unanticipated results, and, if you are unhappy with that, the solution is often to pipe the output through grep, to try to narrow it down on just what you want.

so, as an example, imagine you were searching for a file whose name you knew contained the string 'xyz'. You might try 'locate xyz', but if that turned up too much, you might think 'I know that it is under my username, so I'll try 'locate xyz | grep -i username', where 'username' is the name of the top level directory for all you user files (the '-i' for 'ignore case' is probably not necessary, in this particular case, but it gets to be a habit).

Find can do stuff with file metadata, which locate can't. So, for example, you can't get it to look at only files created within a certain date range, and similar clever tricks. You'll spend a little time with the man page to do it, though (or search for a tutorial, with your favourite search engine).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Random Linux Commands to Make Google Talk, Fix Wifi, Find Duplicate Files, and More LXer Syndicated Linux News 0 11-10-2012 06:21 PM
Need help to find a small and easy linux distro please. hishulta Linux - Newbie 7 04-21-2011 08:21 AM
I can't seem to find any easy to use cyber cafe timer for Linux. Rassie Kariuki Linux - Newbie 1 05-19-2010 10:25 AM
how can i find linux commands? kamalkirat1 Linux - Software 4 11-22-2008 11:19 AM
fast easy way to find old files to delete??? lowlight1177 Linux - Software 2 04-06-2006 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:28 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration