As a Linux tinkerer, here is a technique I use to log what I've done and make notes. This applies to commands I type in the shell, especially when I'm configuring the system as root.
In my own ~/bin directory, which I've placed onto my path (put "PATH=$PATH:$HOME/bin ; export PATH" in ~/.bashrc), I have a script called "myinstall" where I type in any command that has to do with administration. Same thing for root. When I'm ready, then I type "myinstall" as a command, and it runs my command. When I have another command, again I edit the myinstall file (commenting out the previous command) and run myinstall again.
For example, in the beginning, myinstall might look like this:
-----( start )
#!/bin/sh
urpmi.addmedia thacs.rpms
http://rpm.nyvalls.se/9.2/RPMS with hdlist.cz
-----( end )
Then when I'm ready, instead of typing "urpmi.addmedia ... bla bla bla" (an example command for this illustration --never mind what it does) at the command line, I just type "myinstall".
Then I'm ready to do the next step, so now myinstall is edited to look like this:
-----( start )
#!/bin/sh
#urpmi.addmedia thacs.rpms
http://rpm.nyvalls.se/9.2/RPMS with hdlist.cz
urpmi --noclean freevo
-----( end )
Then when I'm ready, I type "myinstall" again.
What are the advantages of this? There are many:
- I can edit my command. I might want to do some cutting and pasting to enter that big long "urpmi.addmedia ..." command. Sure, you can do some command-line editing, but it's much easier to use a text editor (KWrite in KDE, or nano in console) and it's more flexible.
- If I make a mistake, I can easily edit and re-execute "myinstall". (Those of you thinking, "but up-arrow recalls the previous command line in the shell" aren't thinking of multi-line commands.)
- I have a record of what I did. In the future, if I can't remember that web site I had to type in as part of the command, or I forget whether the correct command was "urpmi -no-clean" or "urpmi --noclean", it's all there for me to see.
- I can comment on what I'm doing! You won't believe how valuable this is. You can insert lines that say, "# Oops, that didn't work let's try it this way instead:", and when reviewing your notes in the future, you can avoid the same mistakes. This is especially when you're debugging some configuration.
- I can easily re-execute the commands if I'm re-installing. In fact, this was the original reason I started doing this: I have two computers, and I didn't want to go through the hassle of figuring everything out for a second time on the second computer. On the other hand, the partitioning and configuration of the two computers is slightly different, so I couldn't just copy all the config files directly. With the above method, I can edit the myinstall file and do what's needed, skipping over the unneeded parts.
At first, each time I ran "myinstall", I then commented out the line(s) so it wouldn't execute again the next time. This got to be tedious, like this:
-----( start )
#!/bin/sh
#install program1 # Okay, done that, so we'll comment this line out.
#install program2 # Okay, done that, so we'll comment this line out.
#install program3 # Okay, done that, so we'll comment this line out.
#install program4 # Okay, done that, so we'll comment this line out.
#install program5 # Okay, done that, so we'll comment this line out.
#install program6 # Okay, done that, so we'll comment this line out.
install program7 # This is what we will do next
-----( end )
Not only did I have to comment out each line, which was tedious (especially if I ran several lines at a time), but if I wanted to redo what I had done before (say, install programs 3 to 6 over again), I'd have to uncomment each line. Then I figured out an easy way to "comment out" huge chunks of lines at a time:
-----( start )
#!/bin/sh
if [ 1 = 2 ] ; then
# This "if/then" is never true, so anything within
# this group is never executed
# --so it's as if we commented it out!
install program1 # Okay, done that
install program2 # Okay, done that
install program3 # Okay, done that
install program4 # Okay, done that
install program5 # Okay, done that
install program6 # Okay, done that
fi # "fi" is end of the "if" structure, so
# anything following this *will* be executed
install program7 # This is what we will do next
-----( end )
And so if I need to install programs 3 to 7 over again, I just move the "fi" line up before "install program3" and it will re-execute.
(For those of you using KWrite with KDE, Ctrl-Shift-B will switch to block mode so you can delete those hash marks "#" in a column without affecting the rest of the lines.)
Anyway, thought that might help. In tinkering with Linux, I've installed a dozen distros on a dozen disk partitions, and wish I had thought of this earlier.