find / -name alpha -exec chmod a+r {} (My space web page)

find / -name alpha -exec chmod a+r {} ; Following -exec, you should specify a complete UNIX command and put {} where the filename will be inserted. Add ; at the end of the command to complete the required syntax. In the previous example, chmod runs on every file named alpha so that everyone can read the file. find / -name core -exec rm -f {} ; This example finds all files on the system named core and executes the rm command to delete them. The - f option to rm is specified so that rm does not ask for confirmation if you don’t own the file and don’t have write permission to the file. This is a useful command for root to run periodically because, if a process aborts, it might leave a debugging file named core in the current directory. After a while, these core files, which are not small, can collectively consume an unreasonable amount of disk space. This find command restores that disk space by finding and deleting those core files. Note - If you have thousands of files to process, xargs (covered in the next section) is more efficient than - exec. For example, find / -name core -print | xargs rm -f This command also deletes all core files much more quickly and with less overhead than the -exec option, which calls rm once for each file. Sams Teach Yourself Shell Programming in 24 Hours Contents Index Hour 18: Miscellaneous Tools Previous Chapter Next Chapter Sections in this Chapter: The eval Command The expr Command The : Command The bc Command The type Command remsh/rsh/rcmd/remote (Remote Shell) The sleep Command Summary The find Command Questions xargs Terms Previous Section Next Section Copyright Macmillan Computer Publishing. All rights reserved.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Leave a Reply