Appendix B: Command-line Reference

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.

DIRECTORY NAVIGATION

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:
find / -name "*.txt" type f exec chmod o-w ˜{} \;

Searches for any file that contains some pattern

grep r pattern * example: grep r passwd= *



Anti-Hacker Tool Kit
Anti-Hacker Tool Kit, Third Edition
ISBN: 0072262877
EAN: 2147483647
Year: 2006
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net