LinuxBasics.org

The community that helps people to run Linux

rss

Finding files

  1. locate: First you need to run updatedb. Note that updatedb can only see those files the user who runs it has permissions to do so. Thus, if you run it as root, you open up a security hole: Anybody could see the filenames of other users. Descriptive filenames in public can reveal private information). Many systems are set to run this as a cron job in the wee hours of the morning as user nobody, who only has limited rights. So, as long as you have left your computer on, your locate-database is updated daily (Or better: nightly). Some systems also run updatedb after startup if the computer has not been on at the scheduled time. This disk-activity without visible cause often irritates users. There is more to know about locate and updatedb
  2. mc (Midnight Commander) is a filemanager that has a command for finding files. F9, go under the Command option, and the second option from the top is “Find File—M-?” Just plug the filename, or the part of it that you know along with an *, into the blank and let it work. It will produce a list of files that fit that description and you can choose from the list.
  3. The TAB key works wonders for finding the name of a command if you know the first letter. Type the letter on the command line and then hit TAB twice and you will get a list of all commands beginning with that letter.
  4. apropos can help you find a command name too. Type apropos followed by a word that is related to what you are looking for on the command line. You can also use grep to narrow it down. For example: apropos mouse |grep config to find something about configuring the mouse.
  5. Tracker or other indexing programs. See LBlog article.
  6. Last but not least, there is find. I go to the top level of the directory that I feel the file is in. Then on the command line type:
    find . -name The dot after “find” says to search the directory you are in and to search down into all directories below there recursively.
    • Find the files that are bigger than 100Mb: change to the top of the directory you want to look at for example cd ~ and then run this command:
      • find . -size +100M

Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/using/finding_files.txt · Last modified: 2008/07/20 21:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig