return to those (Professional web hosting) gawd-awfully long commands you pecked
return to those gawd-awfully long commands you pecked at a while ago even days ago! Let me give you an example. Suppose that yesterday you man- aged to issue a command to find all the core dumpfiles in your system (coredump files are massive files containing debugging data that only an expertprogrammer or your computer can understand) and delete them. The com- mand looked something like this: find / -name core -exec rm {} ; To re-execute the command, all you need to do is fish it out of your shell his- tory and rerun it. The simplest way (if you re repeating the exact same versionof the command you used last time, which in this case would be the findcommand) is to type !findand press Enter. Doing so tells your system tolook through your history and rerun the last instance of findin the list. On the other hand, if you have run the findcommand more than once andwant to make sure that you re re-executing the right version, you need toread through your command history. You can do so line by line by pressingthe up-arrow key repeatedly until you locate the command you want to re-execute. Then just press the Enter key to run the command again. The historycommand lists your last 20 commands (by default) when youenter it at the prompt, in case you re curious about what they were. Working with VariablesVariablesin the bashshell are words or strings of text that computers use torepresent a piece of data. An example of using a variable is setting the variablefruitto contain the text apple. A number of standard variables containinformation about your account and environment settings. Variables versus environment variablesThe first thing I need to make clear is that the bashshell has two classes ofvariables: Variables:A variable can be referenced in a program or shell session, but it s visible and available to only that session or program. Environment variables:An environment variable can also be referencedby the shell or program. However, it has the added behavior of havingits value copied to any other program or shell that is created from itsenvironment. 284Part III:Getting Up to Speed with Linux