Files & Filesystems / File Location
Subtitles of the Movie
Exam objective 1.104.8 has a weight of 5, and verifies that candidates are thoroughly familiar with a file system hierarchy standard, including typical file locations and directory classifications. You should be able to find files and commands. The file system Hierarchy Standards Group has written a detailed description of the names of directories and the things that go in them. The standard is for Unix systems in general, but it has a Linux system specific addendum. This standard hierarchy will tell you where to put things when you install software, and where to find what you're looking for. There are a number of ways to find files. Probably the simplest is Wich. It looks on your path for an executable file and if it finds one it shows you where it is and stops. For example, I have a few versions of Java installed and I switch among them by changing the path. I can use the Wich command to verify the one that I want is the one that will execute. As you can see the path is set for Version 1.6 to execute. There may be others later on in the path, but this is the one that will run. The Whereis command is a little different. It looks in some standard places for the executables and MAN pages. It found and listed both of them. If Source for LS had also been installed in the regular place, it would have found that, too. The Find command, described in an earlier lesson, will search through an entire directory tree to find a pattern match on a regular expression, but there is another that also does a file search on a regular expression. Locate uses a database to search for files, so it's very fast. That file search was just made on a pair of multi-gigabyte drives. This was a search for a specific file name, but you can also use regular expressions. For Locate to work, it requires a database of file names. The program that generates the database is Update DB. It's run automatically once a day. It's run by the system crontab which has several system scripts that it runs each day. It varies a bit, but normally runs early in the morning. You can use other database files, but the default location of the file is set at installation. The Update DB configuration file is a text file where you set configuration for things like which directories to skip, which network paths, if any, to add to the search area, and what priority is to be used when building the database. The file is well-commented, and easy to edit. It's just a script that sets some environment variables for Update DB. There is another version of Locate; it's called SLocate for Secure Locate. It works the same way as Locate, but the file ownership and permissions are also stored in the database and the search ignores the files that the user doesn't have permissions to access. This lesson only has one exercise, but it is an important one. Read the hierarchy document while exploring the files and directories of your system and see what files you have and where they're located. You need to be familiar with this layout.
Tutorial Information
| Course: | Linux Professional Institute: Level 2 |
| Author: | Arthur Griffith |
| SKU: | 33894 |
| ISBN: | 1-934743-79-8 |
| Release Date: | 2008-07-21 |
| Duration: | 7.5 hrs / 113 lessons |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 