104.7 Find System Files and Place files in correct location

  • Understand correct locations of  files under the FHS.
  • Find files and commands on a linux system.
  • Know the location and purpose of files and important files and directories as defined in the FHS.

Commands : find, locate, updated, whereis, which, type

Understand Correct locations of files under FHS

The File System Hierarchy Standard(FHS) specifies guidelines for the location for various files and directories.

Enhances compatibility between systems which are FHS compliant.

Find Files and Commands on Linux System

The locate command find files and paths quickly within ‘mlocate, database

The ‘updatedb’ command update database based on configuration at /etc/updated.conf

‘whereis’ command locate the binary, source and manual pages of command within mlocate database.

The ‘which’ command searches the current path for the command.

which ifconfig

The ‘type’ command displays information about an alias, shell reserved word, function, built in, or disk file.

type  -a echo

type -p date

type -t ls

The ‘find’ command




find . -name “file*” -exec ls -l {} \;

find alls files starting with ‘file’  and do a long listing.

find  / -group user1

find all files belongs  to the user group user1.

find / -size +100K

find all files greater that 100KB

find / -amin +3

find files modified more than three minutes ago

find / -ctime -1

find files changed less than one day ago

find / -empty

find files with zero length

find / -executable

find executable files

Know the location and purpose of files and important files and directories as defined in the FHS.

Leave a comment

Your email address will not be published. Required fields are marked *