Web hosting unlimited bandwidth - cd / find . -name alpha -print Sample

cd / find . -name alpha -print Sample output: ./reports/1998/alpha ./reports/1998/region2/alpha This point about relative versus absolute pathnames is important if you are using find to generate a list of files to be backed up. It is better to back up using relative pathnames that enable the files to be restored to a temporary directory. Some versions of UNIX let you search multiple directories with one find command: find dir1 dir2 -name alpha -print Refer to the man page about find on your UNIX system to see whether it enables multiple directories. find: -name Option The -name option enables us to specify either an exact or partial filename for find to match. find checks for a match only in the filename and not in the directory portion of the pathname. find / -name alpha -print /tmp/alpha has a matching filename and would be displayed by this command. /reports/alpha/file2 would not be displayed because find ignores the directory portion of the pathname. To specify a partial pathname, use filename substitution wildcards (refer to Chapter 8) . For instance, find / -name ‘*alpha*’ -print This displays all files that contain alpha anywhere within the filename. Here is some sample output: /reports/1998/alpha /reports/1998/alpha2 /reports/1998/old-alpha /reports/1998/region2/alpha /tmp/alpha /usr/fredp/ralphadams All the wildcards covered in Chapter 8 can be used: * ? [characters] [!characters] You must enclose the filename containing these wildcards within single quotes (see Chapter 9); otherwise, your find command does not always give you the desired results.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply