In Short: One of the most important reasons why computer-savvy individuals consider Linux as the best operating system is because it is far more customizable than its popular counterparts. With Windows and Mac, there are plenty of restrictions that limit what you can do to the OS.
Linux- sometimes referred to by the press as ‘Windows NT’s worst enemy’. Wired Magazine once called it ‘The greatest story never told’. This is a perfect definition because the story behind Linux is indeed a great one, yet it is unknown to so many people. Let’s start at the beginning.
Linux is released under something called ‘open source license’. Open source is really more of an idea than a thing. Linux is released with all the source code and files that it was made with. This means a few things. Anyone who is good at programming can mess with the Linux code and release his own version of it. This also means that even though if you buy Linux in a store it will cost money, you’re not paying for the actual Linux itself. Your money goes to the price of packaging, the extra software that comes with the operating system, and technical support. The second, and most important reason that Linux is a big deal is because it’s a much more stable operating system than Windows. It runs on any system; even bottom of the line 386’s from before Linux even came out. Programs running under Linux almost never crash, and in the off chance that one does because of bad programming by the program author, it will not take the operating system down with it. Another important reason Linux is good is that it is secure. It is much harder to bring down by a hacker than Windows is . This is just an extremely short list of the reasons why Linux is so great. For further reading check out www.linux.org
– Introduction To The Console
Even though you’ll probably be able to do everything with ease using the X Windows GUI, there is still some stuff you should know. First off, don’t rely on a GUI for everything! That is very important because you will learn a lot by using the console. The console is more powerful and can do a lot of things you would REALLY like if you’ll just grab a good basic Unix book and start learning. After you do, you’ll find yourself often opening an X Term window to run some console commands which you cannot run from X. If you selected to start the GUI interface when Linux loads up, there are still lots of ways to get to the console.
The console prompt should look somewhat like this (if you’re logged in as root):
The first part identifies who you are, and the ‘#’ is the actual prompt. Any almost and UNIX type system, the ‘#’ means you are root. On non-root bash consoles (BASH – Bourne Again Shell. BASH is the most popular text-based shell. Confused? Don’t worry, we’ll get to that in a second) this will be replaced with a $. Anyway, you can change the prompt, but we won’t get into that now.
You use a shell everytime you’re in the Linux console. What a shell is, is the program that communicates between you and the Kernel (the kernel is the core of the system). Let’s think of it as an interpreter for for two people who are trying to have a meeting, except they don’t speak the same language. One speaks English and the speaks, oh let’s say Hebrew. To communicate with each other they need a guy who speaks both English and Hebrew. If the English guy wants to tell the Hebrew guy something, he tells it to the interpreter in English, and then the interpreter tells it to the other guy in Hebrew, and vice versa. Well anyway, getting back to the subject, this is the case with Linux. Your language is the Linux commands, and the Kernel speaks it’s own very complex language. When you want to talk to the Kernel, you tell shell in your language, and the shell tells it to the Kernel in it’s language. On any Linux system, there a few shells. Some of them are:
The most popular and powerful shell is ‘bash’ (borne again shell). We won’t go that much into shells, because you don’t need to know that much about them just yet.
– Navigating The File System
The most important thing to know when using the console is how to navigate the file system without a graphical program.
The first thing to understand about this is that the bottom directory, the directory that everything else is a subdirectory of is ‘/’. It’s like ‘C:\’ in Windows.
Ok, you start at the console and as a default you’re either in your home directory (every user has a home directory which contains his personal configurations files). Now you want to navigate to another directory. But wait, you don’t know any other directories! You’ll a directory listing for this, right? To do this type ‘ls’ at the prompt. ‘ls’ is the equivlant to ‘dir’ in MS-DOS, and stands for list. You’ll get a list of files and folders. To make the list a bit more readable, try ls -Fla. The -a shows files which start with a period (for example: .Xclients-default). The -l displays file permissions and displays everything in neat columns. The -F option adds a / after a directory and a * after an executable file. I also
suggest using ls -Fla –color to let the system color-code different files (may not be available on some systems).
Anyway, now that you what directories there are, you need to know how to get into them. Luckily, you use the same command as you you use in MS-DOS, the ‘cd’ (change directory) command. Let’s say you’re at the bottom directory, ‘/’ and you want to get to ‘/root’. You simply type ‘cd root’. There is no need to type ‘cd /root’, because you’re already in ‘/’. Now let’s say you want to get to ‘/root/bin’. This would be done by typing ‘cd bin’. There is no need to type ‘cd /root/bin’ (the “full path” of the directory), since you’re already in ‘/root’. Instead, you can use a “relative path”, which is a path that is relative to the current directory you’re in. Type pwd to find out where you are (pwd stands for print working directory).
Now let’s say you’re in ‘/root/bin’ and you want to get to ‘/usr’. You would type ‘cd /usr’. This is to signify that the ‘usr’ directory is under ‘/’, not ‘/root/bin’, or even ‘/root’. Got it? Ok, just one more thing. If you’re in a subdirectory, and you want to get to the top directory, just type ‘cd ..’. Let’s say you’re in ‘/root/bin’, and you want to get to ‘/root’. You could
just type ‘cd /root’, but hey, ‘/root’ is five characters! If you want to save precious miliseconds, just type ‘cd ..’, since ‘/root’ is the directory in which ‘/root/bin’ is a subdirectory of. So in other words, . is the current directory, .. is one directory above, … is two directories above etc’.
– Basic File and Directory Commands
There are lots of file and directory commands in Linux, but we’ll start with directory commands because they’re easier. First off, you have ‘mkdir’. ‘mkdir’ stands for make directory and the context is:
Some rulse apply. If you’re ‘/’, it will make the new directory under ‘/’. If you’re in ‘/usr’, it will make the directory under ‘/usr’. Of course though, if you’re in ‘/’ and you want to make a directory called ‘stuff’ under ‘/usr’, you would simply type ‘/usr/stuff’.
The next command is the ‘rm’ command. It works with files and direcotires and is used to delete some, it stands for ‘remove’. If you want to remove a file called ‘this.gif’, you would go to the directory where that file is and type ‘rm this.gif’. Or let’s say again you’re in ‘/’ and ‘this.gif’ is in ‘/usr’, you would type ‘rm /usr/this.gif’. It works the same way
with a directory.
Next are the ‘cp’ and ‘mv’ commands. They’re both relativley simple, but we’ll start with ‘cp’. ‘cp’ stands for copy, and is used to copy a file from directory to another. The context is:
cp /directory_where_it_is/filename /directory_where_you_want_to_copy_it
Of course if you’re already in the directory where the file is, all you need to type is:
cp filename /directory_where_you_want_to_copy_it
‘mv’ works the exact same way, except it moves the file instead of copying it. This means it deletes in from the original directory and puts it in the new one.
– Finding and Viewing Commands
To find a file, oyu use the ‘find’ command. It then followed by the directory where you want to start looking, then the ‘-name’ arguement to say that you’re searching for a filename. Next you type the name of the file. Let’s say you’re looking for the ‘this.gif’ in the ‘/usr’ directory, the context would look like this:
find /usr -name this.gif
The find command doesn’t stop at filenames, it can also search a file for a paticular string of text. It has the same context as the find file command except you put quotes and asteriks around the string of text. So if you wanted to search the ‘/usr’ directory for a file containing the string ‘hello’, you would type
find /usr -name “*hello*”
Ok, once you find a file, you want to view it right? Well, you could open the file with a text editor, but we haven’t learned to use tetx editors yet, and anyway if the file you want to view is important you might accidently change it and save it using a text editor. That’s what the ‘cat’ command is for. Let’s say you want to view a file called ‘stuff.txt’ in ‘/root’. You would navigate to the ‘/root’ directory and type ‘cat stuff.txt’. Or from any directory, type ‘cat /root/stuff.txt’
-= For more commands, buy a good basic Unix book =-
There are lots of commands in Linux for configuring everything to user passwords, networks, and the message that comes up when you start Linux. With so many things to configure, luckily there is one program that does it all.
Just type ‘linuxconf’ at the command prompt, and you’ll be brought to the Linux Configuration program.
– Mounting Drives
In Linux, drives not only have to be physically mounted to the computer, but mounted in software too. In the KDE and GNOME GUIs, you can easily mount a CD-ROM or disk drive by clicking on the ‘CD-ROM’ or ‘Disk Drive’ icons on the desktop.
– How to mount
Remember earlier in this tutorial when we went over how a hard drive partition is almost like a separate hard drive? Well, just like a separate drive, partitions also have to be mounted. The main use in this is being able to
mount Windows partition and access Windows files in Linux. Obviously, Windows software will not run under Linux but there is still a use for accessing Windows files in Linux.
Let’s say you can’t use the internet in Linux. You ISP only allows to dialup with software and they don’t make it for Linux, you’re not used to Linux yet so you don’t want to use the net in it yet. This is a down point, but it doesn’t mean you can’t download Linux files to use. All you have to do is download the files in Windows and access them in Linux.
To mount a windows partition in Linux, yhe first thing you must do is create a directory in Linux where you will mount the windows partition to reside. Go into file manager (it should be under utilities no matter what distribution you’re using) and create a new directory under ‘/’. Call anything, I suggest calling it ‘windows’. Now exit file manager and go
into ‘terminal’ (should also be under utilities). Terminal will give you a command prompt just like MS-DOS. This is what you would have to do everything from if there were no X Windows GUI. The command to use is simply enough- ‘mount’. But don’t type it just yet, you need to give the system more info. The full command is
mount -t vfat /dev/xxxx /yyyyyyy (yes there is a space between ‘xxxx’ and ‘/’)
Or mount -t vfat32 /dev/xxxx /yyyyyyy in case this is a FAT32 partition.
Where ‘yyyyyyy’ is the directory you just created, and ‘xxxx’ is the device name of the partition where Windows resides. It is usually hda1 or something.
There, now just go into file manager and click on the directory you created and you will have all the files that are on your windows partition.
When you’re done, don’t forget to unmount the drive by typing:
umount /dev/xxxx /yyyyyyy
Each time you want to access your windows files, just mount the partition (unless they’re set for automount. Edit /etc/fstab, find the line that represents your Windows partition and look for a place with says noauto. If you find the word noauto, change it into defaults. If you don’t, your Windows partition will probably get automounted whenever you boot-up Linux). When you’re done with them, just unmount the partition.
While Windows is booting, have you ever pressed the F8 key? Well, if you have, you’re probably familiar with a screen that pops up giving you a list of ways you can load Windows. There’s safe mode, command prompt, step-by-step confirmation, etc. Linux has something just like that, and they’re called ‘runlevels’. There are six runlevels in all, and some are pretty much the same. A runlevel is a list of commands to load-up as soon as you start up Linux . Your default runlevel is probably 5. If you configured the GUI to start up when you boot the system, and if your default runlevel is 5, then that is the runlevel configured to boot the GUI when it starts up…simple, right?
Well anyway, if you use linuxconf to change your default runlevel to 2 or 3 or something, then you change it so that the GUI won’t start as soon as the system boots….all without touching the actual runlevel. When you want to change it back, just use linuxconf to set the default runlevel back to 5.
Now let’s say you only want to load it without the GUI coming up once. Instead of having to change the configuration in linuxconf, and then changing it back, you can load Linux into another runlevel. Suppose You want to load runlevel 2…not for any paticular reason, just because it’s not configured to load the GUI when it boots up, and well, you like the
number 2. To do this, as soon LILO comes up (whether it’s on your computer, or your boot disk), you have the option to type something next to ‘boot:’. Just type ‘linux x’. ‘x’ refers to the number of the runlevel, in this case the number 2, so you type ‘linux 2’, and press enter. This will load Linux without loading the GUI. When you restart Linux, it will load the default runlevel again.
For an interesting runlevels-related local hack, read the Byte-Me mini-tutorial about runlevels .
You are now officially a Linux user. Check out for links to some great Linux sites. The best way to learn about Linux is by messing around with it. In an hour of playing with Linux you can learn a lot.