101 4.7 find system files and place files in the correct location

9
Junior Level Linux Certification

Upload: acacio-oliveira

Post on 07-Dec-2014

328 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: 101 4.7 find system files and place files in the correct location

Junior Level Linux Certification

Page 2: 101 4.7 find system files and place files in the correct location

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

Page 3: 101 4.7 find system files and place files in the correct location

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

Page 4: 101 4.7 find system files and place files in the correct location

Filesystem Hierarchy Standard

4

Ex:

Create partitions and filesystems

Page 5: 101 4.7 find system files and place files in the correct location

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.

Page 6: 101 4.7 find system files and place files in the correct location

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

Page 7: 101 4.7 find system files and place files in the correct location

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:

Page 8: 101 4.7 find system files and place files in the correct location

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:

Page 9: 101 4.7 find system files and place files in the correct location

Fim de sessão

9