Date post: | 07-Dec-2014 |
Category: |
Technology |
Upload: | acacio-oliveira |
View: | 328 times |
Download: | 0 times |
Junior Level Linux Certification
Exam Objectives
Key Knowledge Areas
Understand the correct locations of files under the FHS. Find files and commands on a Linux system. Know the location and purpose of important file and directories as defined in the FHS.
Objective 4: Devices, Linux Filesystems, Filesystem Hierarchy Standard
Find system files and place files in the correct location Weight: 2
Terms and Utilities
find locate updatedb whereis which type /etc/updatedb.conf
2
File system Hierarchy Standard
3
Directories required in / by the Filesystem Hierarchy StandardSet of requirements and guidelines for file and directory placement under UNIX-like operating systems.
Directory Description
bin Essential command binariesboot Static files of the boot loaderdev Device filesetc Host-specific system configurationlib Essential shared libraries and kernel modulesmedia Mount point for removable mediamnt Mount point for mounting a filesystem temporarilyopt Add-on application software packagessbin Essential system binariessrv Data for services provided by this systemtmp Temporary filesusr Secondary hierarchyvar Variable data
http://www.pathname.com/fhs/
Create partitions and filesystems
Filesystem Hierarchy Standard
4
Ex:
Create partitions and filesystems
Locating Files
# find /home/angie –name stuff/home/angie/stuff
# find /home/angie –user root/home/angie/morestuff
find utility is used to search for files.
5
Find system files and place files in the correct location
Syntax: find /path expression
Ex:
Options:-atime Searches based on the number of days since last accessed.-ctime Searches based on the number of days since directory entry last changed.-group Searches for files belonging to the specified group.-newer Searches for files more recent than the specified file.-name Searches for files with names matching the specified string.-user Searches for files belonging to the specified user.
Locating Files
locate provides a secure way to index and quickly search for files on your system.Uses slocate database, by default, to find file locations. Db is updated with cmd updatedb
6
Find system files and place files in the correct location
Syntax: locate –options arguments
Options:-u Start at / when creating the slocate database.-U /PATH Start at the specified path when creating the slocate database.-e DIR Exclude the specified directories when creating the slocate database.-c Parses the /etc/updatedb.conf file when creating the database.-i Searches without regard to case.-o FILE Specifies the output file to create.-d PATH Specifies the path of databases to search.
The database is located in: /etc/updatedb.conf
Locating Files
# which locate/usr/bin/locate
which takes one or more arguments. For each argument it prints to stdout
7
Find system files and place files in the correct location
Syntax: which –options program-name
Ex:
Locating Files
whereis locates source/binary and manuals sections for specified files.
8
Find system files and place files in the correct location
Options:
-b Searches for binaries.-m Searches for manual entries.-s Searches for sources.-u Searches for unusual entries that don’t have one entry for each type.-B Changes where whereis searches for binaries.-M Changes where whereis searches for manual sections.-S Changes where whereis searches for source code.
# whereis lsls: /bin/ls /usr/man/man1/ls.1.gz
Ex:
Fim de sessão
9