beginning Linux guide
This was taken from an email I sent to Jem and Trinity about beginning in Ubuntu Linux. It might also be useful to see my dated Beginning Linux Commands guide. Any questions about something I do or don’t have on here, as well as your own Linux tips, can be posted as comments.
Note: Don’t look on this guide as though you have to learn all this stuff right now in order to be able to use Linux. No. You can get around otherwise, enjoying Linux and getting work done at the same time without messing around with the command-line, which is what a lot of this guide deals with. Look over this guide and then pick and choose what you need. Want to learn how to change file permissions? Check out the section on the chmod
command. Want to know what program to use for a certain task? Check out that section. You don’t have to memorize all this stuff to get around, but it’s there if you need it.
Useful Links
- The “Linux related” section has some good articles.
- Linux help (and other) links.
- “Notes and tips for beginning in Linux”
Command-Line Interface Beginning Commands
- cd change directory, e.g.,
cd /home/melissa
- ls list the contents of a directory, e.g.,
ls /usr/local/src
- mv move something to somewhere else, rename something, e.g.,
mv john.txt mary.txt
- cat the intended purpose is to concatenate two files together, but I usually just use it to display short files, e.g.,
cat jilly.txt
- less display, and be able to navigate through and search, a file; hit q to quit; hit / and then type something and hit enter to search, e.g.,
less missy.txt
- grep, search for something in file(s), e.g.,
grep "ugly man" *.txt
,grep -rI 'frogger'
- man, display a manual for a given command; hit q to quit; acts like
less
, e.g.,man less
- rm, delete a file or directory, e.g.,
rm pinky.jpg
,rm -r directory/
- which determine where a program is located, if you even have it, e.g.,
which mozilla-firefox
- whoami display which user you are, e.g.,
whoami
- chmod change permissions on a file or directory, e.g.,
chmod 755 jim.sh
- locate locate instances of a word on your system; good for finding config files, executables, etc., e.g.,
locate firefox
Debian (or Debian derivative) Commands
apt-cache search SOMETHING
- Search the Debian archives for SOMETHING.apt-cache show PACKAGE
- Show info about PACKAGE, such as its name, size, description, dependencies, etc.apt-get install PACKAGE
- Install all the dependencies for PACKAGE and PACKAGE itself.apt-get update
- Run before dist-upgrade-ing.apt-get dist-upgrade
- Upgrade all out-of-date programs on the system.
Installing TrueType Fonts
- Copy your new font(s) into
/usr/share/fonts/truetype
- Run
ttmkfdir
- Restart Gimp (or whichever program you wish to use them in.)
Chmod Tutorial
U G O
rwx rwx rwx
421 421 421
- read = 4, write = 2, execute = 1
- U = user, G = group, O = other
For example:
-rwxrwxrwx
-rw-rw-rw-
-rwxr--r--
You add up the permissions you want and stick them in the slot you want. If you want the user to be able to read and write to a file, that’s 4 (read) + 2 (write) = 6 (e.g. chmod 644 harry.html
). This was the way I learned, but there’s also a simpler way. person+permission
to add a permission (e.g. chmod g+x jim.sh
) or person-permission
to remove a permission (e.g. chmod o-w yellow.txt
).
Programs I Recommend for a Given Task
- Music player - amaroK
- Browser - Firefox
- HTML editor - vim or Bluefish
- Graphics editor - The GIMP
- Office suite - OpenOffice
- Mail - Thunderbird
- Instant messenger - gaim (supports AIM, Yahoo!, ICQ, Jabber, etc.)
- CD ripper - Sound Juicer, grip, or ripperx
- Card game - Pysol (has freakin’ tons of different card games)
- Window manager - IceWM
- File browser - Krusader (Gnome probably has an equivalent) or mc (without a GUI but very powerful–type from a command-line)
General Tips
- Always try to apt-get a program before installing from source. It keeps your system cleaner and everything more interconnected, making it easier to maintain and update.
- The
man
command is your buddy. - If you’re having a problem (e.g. your music player won’t play any sounds), chances are someone else has had the same problem before. Google a description of your problem; if it’s a lack of configuration for something, you’ll probably find a HOWTO describing how to get things set up (e.g. The Linux Sound Playing HOWTO).
- Get used to the command-line. Being able to work with just a GUI leaves you out of a lot of the beauty of Linux (and Macs). If you’re comfortable with both the GUI and the CLI parts of an operating system, you’ll be a lot more versatile, of course, (so if your X server won’t start and all you have is a console, you can still get around, edit some config files, and get stuff working again) and you’ll be able to do things faster because GUI’s may be pretty, but they aren’t always the shortest route to accomplish a task.
- Vim is great. It’s a text editor that’s insanely powerful because it’s got a ton of commands. There’s a steep learning curve but it’s worth it.
Webserver Stuff
Problem: /var/www
is by default accessible by root only, but you want to stick your web page stuff there to be able to access it at http://localhost
Solution: You don’t even have to mess with /var/www; in your home directory (cd ~
or cd
or cd /home/USER
will get you there), make a directory called public_html
if you don’t already have one. You can put your web stuff in there and then access it at http://localhost/~USER