Concepts:This chapter discusses more utility programs that are included in UNIX/Linux. The first several pages list utilities according to eight types. The organization of eight tables by these types is meant to help you find the right tool for a task that suddenly appears.
The text lists and briefly describes many utilities in several tables. Mercifully, it only spends the next 25 pages discussing them. We will concentrate on a few. File processing utilities The dd utility is used to copy files when you need to specify parameters for the destination file that are different from the source file. The text gives us examples of converting from one character code to another (like ASCII to EBCDIC), one block size to another, one case to another, and from variable length records to fixed length records. The df and du commands are related.
Garbage files are files on a system that have no further purpose for the user or process that created them. In order to find them, however, users should be taught to name their files in reasonable ways, such as appending .test or .tmp to files that are only to be used in a test or a day's events. With names that we can trust, we can run searches for files of that we are sure should be removed from a system. Note the syntax of the command on page 410 that uses find to locate files named either a.out or core, then uses the -exec option of find to run the rm command on each filename that is found. This kind of script should be checked for errors very well before it is trusted to run. System status utilities On page 411, the text discusses the top command, which runs a check on the system's CPU, and returns a list of the processes that are causing the heaviest load on it, updating the list every five seconds while top is being run. top runs until you stop it by pressing q, for quit. While it is running, you can press k (for kill) to bring up an interface to kill (end) a process that should not be allowed to continue. On page 412, the text describes the free command, which reports information about system RAM. It can be set to run continuously with the -s option. If running continuously, quitting is done by typing ctrl-c. Managing processes The text reminds us (if we already know) that processes running in memory are assigned process ID numbers, also called PIDs. You can see four of them in the image above for the top command. The text tells us on page 414 that we might want to run top in the background instead of running it in its normal mode, which takes over the terminal console. The command to run any process in the background is just to add an ampersand (&) to the command that starts the process. Any program that is running may start several processes, which makes it hard to keep track of them. The text explains that we can use the ps command to list all or some of the processes that are currently running. You already know that you can run the top command and kill a process from it. But that only gives you access to the most processor intensive processes. To kill any process, you can use the kill command (assuming you have rights to do so). To kill a process the syntax is kill PID, or kill processname. Check spelling The text mentions a rather specialized command, ispell, which is a spelling checker for text files. This program is more useful for systems in which you cannot install a word processor that includes a spelling checker. If that kind of addition is not practical, you can use the ispell utility, providing it is in included in your Linux distribution. I tested the ispell command in my copy of Fedora 24, and found I had to install a new package to use it. It then gave me an argument about not having it set up properly. You will probably need to skip Project 8-11. Network utilities On page 435, the text begins a discussion of several utilities that relate to network setting and use.
|