Unix help
Fundamental Concepts
The Shell
Whenever you're at the command line, you're using a "shell" to interact with the computer. Shells, as the name suggests, separate users and allow them each their own unique interface. They're also nesting (think Russian dolls, only with lots of space between each doll). I can be logged in as "joedirt, type "su fishpaste" (followed by fishpaste's password), and find myself in a new shell for fishpaste. Any changes I make to fishpaste's shell will not affect joedirt's. Similarly, I can be logged in as "mork" on my machine, then use ssh to log into cs as "mindy". Again, this is a separate shell and won't affect mork's carefully edited .bashrc file.
Permissions and Root
Every file and directory on a unix box has a set of permissions. This set specifies different users' abilities to read, write, and/or execute. The permissions are divided into three categories: owner (each file has a unique user classified as owner), group (which can contain any number of users), and everyone else. This allows the owner to give only the minimum necessary access to other people.
You've probably heard "1337 haxxorz" claim they've "rooted" a box. Each Unix system has "root" account with access to everything. This can be very good or very very bad, depending on the circumstances, and you should be very careful when logged in as root. This is where you can accidentally destroy your filesystem and lose all your data with a single command, or where an attacker can "own the box", changing your passwords, deleting your logs, replacing harmless programs with malicious ones. On the other hand, you'll be able to access all parts of your system and do some pretty cool things, so be careful, not afraid.
Basic Tools
- cd - "Change directory."
- ls - "List contents of directory."
- mv - "Move a file or directory."
- cp - "Copy a file or directory."
- cat - "Concatonate and print files." Dumps it all on you at once.
- more - Like cat, but presents it in a scrollable, more user friendly form.
- less - "Less is more." A newer version of cat.
- pwd - "Present working directory." Displays the full path to the directory you're currently in.
- echo - Prints argument to the screen.
- top - Displays the top processes running based off of CPU usage. Lots of handy info here.
- ps - "Process status." Like top, but only lists processes you are currently running from terminals.
- printenv - "Print environment." Prints all your current environment variables.
- passwd - Set a user's password (yours by default).
- su - "Substitute user." Gives you a new shell for a specified user (or root by default).
- sudo - "Substitute user do." Execute a command as a specified user (or root by default).
- chown - "Change owner." Modify the owner and group of a file.
- chmod - "Change file mode." Change permissions for a file or directory.
- ssh - "Secure shell." Using the miracles of the interweb, we can now talk to our computer without being right in front of it.
- scp - A version of copy that uses ssh to transfer files between computers.
- exit - Close the current shell.
- reboot - Exactly what you think it does.
Man pages
Man pages are your friend. All of the standard Unix tools (and most tools you install) will have a man (manual) page. You'll find information on what they do, how (and often advice on when) to use them, what options are available, and occasionally the odd history or math lesson. When all else fails, start here.