Chapter 6 . Managing Files 249 find The (Web design templates)

Chapter 6 . Managing Files 249 find The find utility is used to search for files. This utility begins searching at a specified directory and will then search all subdirectories contained within that directory for filenames matching the specified pattern. When no directory is specified, the find utility begins by searching the pwd and then searches all subdirectories located within that directory. The correct syntax for this utility is as follows: find /path expression Searches using the findutility can take a while and use a lot of system resources depending on the search being done. Table 6-11 shows some of the various conditions that can be searched for using find. Following is an example of the use of the find utility. # find /home/angie name stuff /home/angie/stuff # find /home/angie user root /home/angie/morestuff Table 6-11 Conditions Used with find Option Use -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. -atime Searches based on the number of days since last accessed. locate The secure locate command provides a secure way to index and quickly search for files on your system. It uses incremental encoding to compress its database to make searching faster, but it will also store file permissions and ownership so that users will not see files they do not have access to. The locatecommand uses the slocate database, by default, to find file locations. It is possible to specify other database files to use. This command uses the following syntax: locate options arguments
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.

Leave a Reply