Finding Stuff

Finding Stuff

Grep

Need to search for text within a file or a bunch of files? grep is what you've been looking for. If you work on a Linux system regularly, then grep should be one of the first tools you master. By "master," I mean learn its options, the use of regular expressions, directory traversing, and combining it with other tools.

Find

Speaking of combining with other tools, find is a tool that searches for files in a directory hierarchy. Combine this with the exec option, and you've got a very powerful tool to perform operations on the files find locates . If you are going to master any other tool beyond grep, master this one.

Lsof

lsof is the nosy system administrator's best friend. Its basic mode of operation is to display all open file descriptors for a process or group of processes, including regular files, sockets, and device files. Say you're trying to unmount a volume and keep getting a "Device is busy" message. Use lsof to find out which processes have a current working directory on the file system you're trying to unmount , and then zap them. Or say netstat shows that you have an unusual TCP connection that you're not familiar with. Use lsof to find out which process is holding the socket open . Say you want to find all processes that are currently using a particular shared library. Once again, lsof comes to the rescue. You'll need root privilege to use the command, but it's an invaluable time saver.

Nslookup

When you're using a browser and you type www.linuxdoc.org , the browser needs to look up the IP number associated with the name www.linuxdoc.org . You can also do the same by using the nslookup command. This command talks to your domain name server to translate IP names into IP addresses and also the reverse of this.

Nmap

This scans large networks for hosts and services. If you're looking for systems on a network and want to know what each host has to offer, nmap is a tool you should learn. You are able to use a variety of seach techniques and can detect such things as operating system type and downed hosts .

Wget

Have you ever wanted a simple command line tool to retrieve Web pages? wget can retrieve one Web page or recursively download a whole Web site over HTTP. You can set it to use many options like HTTP authentication, report a specific user agent, even add arbitrary headers and cookies. wget is even capable of doing single or bulk transfers from FTP sites, even ones requiring a username and password. The rich feature set puts it head and shoulders above other file-retrieval tools.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

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