| ||
This appendix provides some basic command-line tricks that ease system administration. Many times a command may already exist for some function that you need to perform. Instead of reinventing the wheel, check out this section. Or if you're new to the Unix environment, take a peek at some of the command-line power missing from the Windows shell. Some of these commands can help you share the results gathered from one of the tools in this book with some other tool, such as generating a target list for nmap.
Capability | Unix and Cygwin |
---|---|
Finds a file or directory name within a directory or its subdirectories | find dir name file example: find ./ -name pass.txt |
Finds a file or directory glob | find dir name " file glob " example: find /etc/ -name "*~" |
Finds files only | find dir name " file glob " type f |
Finds files and executes a command on them | find dir name " file glob " type f exec cmd ˜{} \; example: |
Searches for any file that contains some pattern | grep r pattern * example: grep r passwd= * |
| ||