07 Jun 2010 @ 9:45 AM 

Very often managing basic things is very important. One of the basic stuff in linux is finding files. This can be done in several ways, but my favorite is using the “find” command like this:

$ find / -name ‘filename.txt’ 2>/dev/null

/ is the start search folder, in this case is root, but can be replaced with wanted folder
-name Given search text is the filename rather than any other attribute of a file
‘filename.txt’ is the filename to search, very recommended is to use single quotes
2>/dev/null is to basically drop the error messages. 2 is the error stream in Linux, /dev/null is the place where everything disappears

Now there is variations for this, you can use * inside the filename given, or to send the error messages to a file instead, but keeping simple is better.

Posted By: Eusebiu Blindu
Last Edit: 07 Jun 2010 @ 09:45 AM

EmailPermalinkComments (0)
Tags
Categories: Linux

 Last 50 Posts
  • Users » 1
  • Posts/Pages » 115
  • Comments » 100
Change Theme...
  • VoidVoid
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight « Default

Bugs

  • No categories

Carnivals

  • No categories

Classic Tests

  • No categories

conferences

  • No categories

EWT

  • No categories

funny

  • No categories

General

  • No categories