
rm unwanted.docin a terminal, unwanted.doc is going to byte heaven (or hell).
rm
alias rm='rm -i'it makes sure that I get asked before the file actually gets deleted. You may want to do the same with other potentially dangerous commands.
alias cp='cp -iv'makes the copy command interactive (i) and verbose (v) so it will both ask you and then tell you what you did.
alias mv='mv -i'also makes the move command (used for moving and renaming files) interactive.
visudoas root. This is essentially a special version of the text editor vi just for creating and editing the sudoers file.
#
User_Alias TRUSTED = mike, mariaThat means that the users mike and maria become the "trusted" users. And what are they trusted with? Jump down to the last line for a second. They are trusted with commands in the group INTERNET, KILL and TOOLS. What are those commands? Jump back up to the section
#Cmnd alias
sudoand the command. For example, if you wanted to update the machines clock to the exact time, you would type:
sudo ntpdate atimeserver.nearyou.gov/edu
suand type the root password. For all intents and purposes you've got a root terminal open now. That means that you can do anything - just as if you had logged in as root in the first place. You're really running the same risks by working as root, but you've at least eliminated the risk of logging in as root. That's quite important from a security standpoint. The real advantage to using su is the possibility to carry out individual commands. Let's say you've downloaded an application and it's only available as source code in a tarball. You can download the source code to your user directory and as a user you can run the configure and make scripts provided with most tarballs. That way, you minimize the risks of compiling the software. If you're satisfied with the binary file (the application itself), then you can use 'su' to install the application and its accompanying documentation in the usual application and documentation directories. Here's what you'd do:
su -c "./make install"You need to add the -c (command) switch and put the actual command in quotes. Then type the root password.
su fdavis -c "less /home/fdavis/my_ideas"and you will now be asked for fdavis' password. Now you can access files from your other user account without having to log in. Other users may also give you their passwords to access things in their account. I question the wisdom of doing that, but in an emergency it's an option. A co-worker who's ill may give you his/her password to access important files. That's acceptable in that kind of situation it seems, but the ill worker should promptly change his/her password as soon as he/she's back at work.