1. Intro
This tutorial was written for fun and it may contain bugs, I was asked to write a short report how to use GNU/Linux, if you are starting to use or if you haven't ever used GNU/Linux and want to learn a tiny bit, take some time to read this. In here you can find some basic tips about GNU/Linux Operating System.
Below you can find some commands (in bold, which ones you can type in the system terminal) and other questions for your help and information, all commands and names are case sensitive, it means "Beny" is different then "beny", uppercase letters are different then lowercase, you must pay attention to that.
2. Startup questions
When you start searching for GNU/Linux, you make up with several questions like "What is GNU/Linux?", "Can i use GNU/Linux like i use other OS?", "Can i trust in it?" "Were is my mIRC???" "Terminal??HELPPPPMEEEE".
GNU/Linux is an Open Source Operating System, the term "Linux" as is commonly referred to, is actually the kernel created by Linus Torvalds and not the whole Operating System, that, we refer to as GNU/Linux, because beside the kernel GNU/Linux has all other tools a GNU OS has.
Of course you can use GNU/Linux with the same proposes you use any other Operating System, for that you have all the tools needed, if your distribution does not bring them by default on the install CD/DVD's, you can easily get them by a search on some dedicated sites or in those applications home-page.
And of course you can trust in it like everyone else does, from a personal home computer to a professional server GNU/Linux is fun, powerful, secure and stable.
Check IRCClients bellow.
The Terminal is the text based way to interact with your system. The same as how you use the GUI (Graphical User Interface), basically you instruct you system with commands in text instead of mouse clicks. The terminal is a faster way to execute several tasks, but sometimes not the most easy to use way. Bellow all commands described are text based, but there are also graphical ways to do the same, I will just not talk about those.
You can use GNU/Linux without knowing any text based command, but time spend working with it will show you that it is sometimes (if not always) faster and precise a text based instruction.
3. What is the GNU/Linux kernel?
The GNU/Linux kernel was originally written by Linus Torvalds. The kernel is the core of the GNU/Linux Operating System, it is the layer between the hardware and the software. It was written following POSIX, the Unix API, thats why sometimes refereed to as *nix, but Linux is NOT Unix, Linux is A Unix.
To find out which version of the GNU/Linux kernel you are running, simply type uname -r in a terminal. For more information on the GNU/Linux kernel, take a look at http://www.kernel.org.
I am not going to cover in this little tutorial more kernel related information.
4. What distribution (distro) of GNU/Linux should I install? Hey I wan't to try GNU/Linux but i don't want to ruin my Hard Drive, is there any other way?
One of the pleasures of running GNU/Linux is choice. The choice of which GNU/Linux Distribution (Distro) you wish to run is 100% up to you. If you are totally new to GNU/Linux in my opinion I suggest you start with Fedora or Mandriva or Ubuntu as they are easier to install doing it in a nice GUI (Graphical User Interface) way, usually referred to as point-and-click "Next", they are also easy to configure, update and maintain, having precompiled packages and ways to automatically obtain and install from the Internet.
You can found a great source of distributions info in distrowatch.
One of the quick ways to try GNU/Linux is to get a Live-CD (LiveDistro), you don't even need to touch you Hard-Drive for nothing, you just need to download the CD/DVD image, often in the *.iso format, and burn it in a CD/DVD (always remember to use burn CD/DVD image option with your CD/DVD burning tool, do not Drag-n-Drop, that will cause the CD/DVD not to boot).
After burning just boot your computer by the CD/DVD (to do this go into your BIOS and change to boot CD/DVD drive first, or press you BIOS boot-menu key at computer start and choose to boot CD/DVD), after that just follow the instructions given, and you should have a quick and easy way to try and run GNU/Linux.
Here is a list of some known Live-CD - http://www.frozentech.com/content/livecd.php.
5. Who is the root user?
The root user is the master/super user or systems administrator of the computer/machine/host. The root user has full access to "all" files and directories, which is why you will only want to use the root account to perform system maintenance. It is really not a good idea to run any other task, like being on IRC with the root account, it's a risk and not worth of it. (As someone said starting the X Windows System (GNU/Linux graphical interface) as root is the same as entering your own house with your boots on fire, eventually nothing could happen but very probably you burn the hole house, or at the very least the floor were you stand.)
If logged with other user, in the terminal just type su and then insert the pass for you to become root user. su is also used to change to other user without log-out as example: Logged in as user beny type su - jane, this will change current user beny to jane, permitting doing anything as regular log-in.
For more info type man su.
As a free and most important tip, lets say you want to do execute or read/write a file/application and your system does not allow it, probably there are just DIFFERENT permissions then the ones you want on that file/application, just change them as there is no explicit reason to run them as root.
6. How do I reboot/shutdown my machine?
In order to reboot/shutdown your machine, you must instruct GNU/Linux kernel to stop all the processes (programs) it's currently running. Do not simply press the reboot/poweroff button on the front of your computer case, as GNU/Linux must be properly shut down/restarted.
Probably your X Windows Manager has that option in the "Log Out" screen.
If not, or if you run plain text mode, to restart/halt your machine, run either of the following commands in a terminal as root:
halt -r now - This will instruct the kernel to reboot the system "now" as in that moment.
halt -h now - The same as above but now the system will halt (shutdown).
For more info on the shutdown scripts, type man halt.
A tip, if you want always to run that or any other command as a normal user use SUDO, and application that permits a certain user or a group or all users, specified in sudoers configuration file, to run a command as root.
7. How do I see which processes/programs are running in my machine?
In order for you to watch out which processes are running just type ps -u that will show the processes running by the current user you are logged in. You can also check which processes are running on the system ps -e .
Other tool is top that shows you, in real time and in a interactive way, the processes running.
You can also use pstree to watch the processes in a tree. For more info please type man ps or man top or man pstree.
8. How do I remove/uninstall Lilo/Grub? (why would you want to do that?)
If you want to remove the Lilo or Grub boot loader from your system (if you are uninstalling GNU/Linux *G*, etc..) follow the procedures below:
For Windows 95/98 etc:
Use a MS-DOS boot disk and at the command prompt type:
fdisk /mbr
For Windows XP:
Boot off the XP Installation CD and go into rescue mode. From there run the command:
fixmbr
9. How do I add/delete a user into my system?
To add;
While logged in as root, type useradd username at the shell prompt, replacing username with the user name you want add to the system. You can create as many users as you wish, one for each member of your family, for example.
For more options check man useradd it is very clear there.
To del;
While logged in as root, type userdel username at the shell prompt, replacing username with the user name you wish to delete.
(Note: Attention this will not delete that user files and personal definitions, for that you need to remove the hole user home directory.)
10. What are groups? Why is the need of that?
Groups are a simple way to 'group' users helping you define who has access to what more easily, for example you are beny and you belong to the group users if you want other users that belong to the users group to access one of your files beside you, you change that file permission to be read and/or written and/or executed by users group members.
How do I add a group to the system?
While logged in as root, type groupadd groupname at the shell prompt, replacing groupname with the group name you with to add.
How do I delete a group in the system?
Using just groupdel groupname with groupname the group you want to delete.
How do I add a user to a group?
Using gpasswd -a user group with user being the username and group being the group name.
How do I change a file/directory/application group ownership?
As root, using chgrp group file being group the group were you want to change the file to be owned.
A practical way to explain this: lets see you have a directory "Last_Winter_Photos" and you want other family members only to access that directory, as root su you need to create a group for example called family, groupadd family then add to the group your family members gpasswd -a dad family and gpasswd -a brotherjakes family and the other members, then change that directory ownership group to family chgrp -R family Last_Winter_Photos and change permissions for the owner and group to read and execute that directory chmod -R 550 Last_Winter_Photos, now all users that belong in family group (your family members) and yourself will be able to see and enter "Last_Winter_Photos" directory but not to change it.
Help: man groupadd, man groupdel, man gpasswd, man chmod, man chgrp
11. How do I change my login password?
To set the password for a specific user, type (while logged in as root) passwd username at the shell prompt, replacing username with the name of the person's password you wish to change.
By typing just passwd you'll be able to change your own password (the password of the user under whose you're currently logged in). Do not use passwords which are easy to guess, like any of your real names or your pets name.
12. How do I change directories?
You can change the current working directory using cd.
Some examples.
Example: cd /home/beny/html - you move to /html that is located in /beny directory that in it's turn is located in /home directory.
Example: cd ../ - to move back one directory
Example: cd - to return to your home directory
Example: cd ~/downloads/videos/ - this will change you to /videos that is located in /downloads directory that for it's turn is located in the ~ home directory of the curent user (for example if you are beny, it is /home/beny/ ).
For more information, in a terminal, type man cd
13. How do I copy files?
To copy files/directories from one location to another use cp
Example: cp /home/beny/index.html /var/www/ - this will copy file index.html to the directory /www/ located in the directory /var/
Example: cp /home/beny/* /var/www/ - this will copy everything inside /home/beny to /var/www/ but not the directory itself.
Example: cp -R ~/downloads/ ~/backup/ - this will copy the complete directory /downloads (including everything inside and itself) to the directory /backup of the current user.
For more information, in a terminal, type man cp.
14. How do I move or rename files?
To move or rename files:
Use: mv file /location/ - to move
Use: mv filename newfilename - to rename
Example: mv index.html /var/www/ - this will move index.html to /www directory that is located in /var
Example: mv index.html index2.html - this will rename index.html into index2.html
For more information, in a terminal, type man mv
15. How do I edit files?
The default editor that ships with almost every distribution of GNU/Linux is vim you can edit a file by typing vim filename, help in man vim.
This editor is slightly advanced and confuses most new users.
And I suggest starting off with Nano, a more simple editor. Nano it's a clone of the Pico text editor with some enhancements. Available for Linux and DOS, home page in http://www.nano-editor.org/ (It might already be installed on your system).
To edit a file with Nano, simply run:
nano filename.
This will open up the file and allow to you edit it. At the bottom of the screen you will notice the various commands that you have access to with Nano. For example if you wish to save the file and exit, simply hold down the control key and hit the x key on your keyboard.
16. How do I list directory contents?
To list the contents of a directory we use ls /directory/
Use: ls [flags] directory
Example: ls - To list the current directory
Example: ls /home/beny - To list the contents of /home/beny
Example: ls -a - To list all files in the current directory
Example: ls -lh - To list file/directory permissions and file sizes in human readable units among other options
Example: ls -alh /home/beny - To list all files, it's permissions, sizes among other things located in /home/beny directory
For more information, in a terminal, type man ls
17. How do I delete files/directories?
To delete a file you must first have write permission to it, see below, once you have write permission, in a terminal run:
rm filename
There is no "Recycle Bin" in GNU/Linux so once you delete a file by the remove command, it's gone for good.
When removing files, you may use an asterisk (*) as a wild-card flag to remove certain files (this also applies to any other command), for example if I wanted to remove all files that began with the letter j, I would run rm j*
To delete a directory if you have ownership to the directory and the directory is empty, you can simply type rmdir directoryname to remove the directory. If the directory is not empty and you wish to simply delete it and all its contents, run rm -rf /directoryname
Please be careful with the -rf flag, as it will remove everything in the specified directory including sub directories. With root access and the -rf flag in rm command you can wipe out your entire system, so do not be stupid.
(NOTE: If anyone tells you to run rm -rf / as root (which is a typical 'joke', specially from those who pretend that are helping you), DO NOT LISTEN TO THEM. Running this command will wipe ALL the files/directories on your GNU/Linux system tree.)
18. How do I access my CD/DVD drive, floppy (and other drives)?mount and unmount?eject?
GNU/Linux requires you to mount your cd/dvd/floppy drives when you wish to use them. In most distributions, the mount command will require root access.
To mount a cdrom, as root, run:
mount /dev/cdrom /mnt/cdrom - this will mount cdrom device in /mnt/cdrom location, generally /dev/cdrom is a link to the real cdrom device.
mount /dev/hdc /mnt/cdrom - supposing the real cdrom device is hdc, this will mount cdrom in /mnt/cdrom
mount /mnt/cdrom - in the case, commonly pre-configured, this will mount cdrom as the system will look into /etc/fstab list to check what device and options are configured to be mount in /mnt/cdrom location.
To unmount the cdrom:
umount /mnt/cdrom - unmount must always be run before ejecting the cd/dvd/floppy, definitely you can't even eject cdrom if you don't unmount it, unless you force the hardware or shutdown the machine. This occurs in order to the drive won't be ejected wile the system is reading from it.
eject or eject cdrom - will eject cdrom form the drive, but only after unmounting.
To mount a floppy:
mount /dev/floppy /mnt/floppy
mount /dev/fd0 /floppy
If you want to mount and unmount cdrom or floppy as regular user, add that user to cdrom or floppy group, that should be enough.
19. How do I view/change ownership on files/directories?
One of the great features of GNU/Linux is that it is a multi-user system.
With multi-users, it allows certain users to own files and directories so nobody else can access/modify them, for example your /home directory. To change the ownership of a file/directory, as root execute the following command in a terminal:
chown username filename - This will change the ownership of the specified file (or directory) to the specified user.
chown username.group directory - This will change the ownership and group ownership of the specified directory (or file) to the specified user and group.
For more information, in a terminal, type man chown
To change ownership of groups only you can use chgrp (see above point number 10)
20. How do I view/change permissions on files/directories?
There are 3 different attributes a file can have that make up the permissions for the file.
There is read access that allows users to read the file.
There is write access that allows users to modify the file.
There is executable access that allows users to execute the file.
From these three attributes, you now have three different levels of permissions, the first is for the owner of the file, the second is for the group the file belongs to and the third is for all other users on the system.
To view the current permissions on files and directories run the following command:
ls -l - and you should see something that looks like:
drwxrwxr-x 3 beny html 4096 Mar 28 23:44 images/
-rw-rw-r-- 1 beny html 267 Mar 28 23:44 index.shtml
The above shows you that images is a directory (d) and that the owner and group (beny html) have read (r), write (w) and execute (x) permissions while other users on the system only have read (r) and execute (x) permissions.
For the index.html file, it shows beny and html as the owner and group and they both have read and write access to the file. It also shows that other users on the system only have read access. Note there is no executable permission since the file is not an executable.
To modify the permissions on a file, you either have to own it or be logged in as root. To modify the permissions, in a terminal type:
chmod xxx filename/directory
You will have to replace the xxx flags with the permissions you wish to change. You can either go by the numerical value or by the actuals.
Some common numerical values are:
755 - Read, Write, Execute for owner, read, execute for group and other.
644 - Read, Write for owner, read for group and other.
666 - Read, Write for all.
700 - Read, Write, Execute for owner, nothing for group, other.
Example:
ls -lh testing/ -rw-r--r-- 1 beny users 7 Mar 28 23:46 filename
drwxr-xr-x 2 beny users 4096 Mar 28 23:45 pictures
-rw-r--r-- 1 beny users 7 Mar 28 23:45 somefile
chmod 755 somefile - This will change permissions on somefile to read (r), write (w), execute (x) for the owner, and read (r), execute (x) for both the group and other users in the system.
chmod -R 500 ~/pictures/ - This will recursively change permissions on /pictures/ directory located in home directory, to read (r) and execute (x) for the directory owner and also all that is inside that same directory, and none for both the group and other users in the system (means they can't do anything with it).
chmod ug+rx filename - This is other way to change permissions, meaning u (user) g (group) + (add) r (read) and x (execute) permissions to that file, this happens to be useful to add permissions, but the same that were before, will continue unless specified in the command.
Result:
ls -lh testing/ -rwxr-xr-- 1 beny users 7 Mar 28 23:46 filename
dr-x------ 2 beny users 4096 Mar 28 23:45 pictures
-rwxr-xr-x 1 beny users 7 Mar 28 23:45 somefile
For more information, in a terminal, type man chmod.
21. How do I find files on my system?
There are two methods to search for files on your GNU/Linux machine, one method is the locate command and the other is the find command. If you wish to use the locate command, you must first update the locate database by running the following command in a terminal as root:
updatedb
This will create an index of all the files and their locations on your hard drive. Once "updatedb" has completed running, you may now search your drive for a specific file by running the following command in a terminal:
locate filename
Another way to search your GNU/Linux system is with the find command. To find a file on your system with the find command, in a terminal run the following:
find / -name filename
Be sure to replace filename with the actual name of the file.
For more info, type man locate, man find
22. How do I extract/create a *.tar.gz *.tgz *.tar.bz2 files?
Firstly this files are archives they are compressed and packed differently, *.tar.bz2 or *.tbz2 are ultimately the smallest archive you can get.
To extract .tar.gz or .tgz files, run the following command in a terminal:
tar -zxvf filename.tar.gz (or filename.tgz) - This will normally create a new directory based on the filename.
To extract .tar.bz2 or .tbz2 files
tar -jxvf file.tar.bz2 (or filename.tbz2) - will extract file.tar.bz2 to file.
To create a *.tar.gz or *.tgz file from a file:
tar -zcvf file.tar.gz file (or file.tgz) - this will create a compressed and packed archive named file.tar.gz from file.
To create a *.tar.bz2 or *.tbz2:
tar -jcvf file.tbz2 file (or file.tar.bz2) - this will create file.tbz2 from file.
For more information, in a terminal, type man tar
23. How do I expand and compress a *.bz2 and *.gz file?
To expand *.bz2 archives, run the following command in a terminal:
bunzip2 -dv file.bz2
To expand *.gz archives:
gunzip -dv file.gz
Now on the other way to compress:
bzip2 -cv file > file.bz2 - this will compress file to file.tbz2.
gzip -cv file > file.gz - this will compress file to file.gz.
gzip -cv file2 >> file.gz - this will add/compress file2 to file.gz archive.
For more information, in a terminal, type man bunzip2, man gunzip, bzip2, gzip
24. How do I install a program?
There are many ways to install applications in GNU/Linux. If the file you wish to install is in .rpm format and you are running an RPM based distribution such as Fedora Core, Mandriva or SuSE, run the following command as root in a shell prompt/terminal:
rpm -Uvh filename.rpm
If you are running Debian GNU/Linux and you wish to install a .deb file, you can do so by running the following command in a terminal as root:
dpkg -i filename.deb or apt-get install package (if you have APT already installed/configured).
If you are running Gentoo Linux and you wish to install a package, just run:
emerge -av application - if you have Internet connection it will download and install the application, else if you need a package you just need to place the source in /etc/portage/distfiles, as there should be already an ebuild for it on the portage.
If you are running Slackware Linux and you wish to install a package, just run:
installpkg package.tgz
Installing by source
If the file you which to install is in a .tar.gz, .tgz or .bz2 format, you will first have to decompress (unzip) the file.
Once the archive has been unpacked and extracted, it should create a directory based on the filename. Simply change into that directory and open up the README or INSTALL file in a text editor and follow the installation instructions.
25. How do I run a program?
To run a program, you must first make sure it has executable permissions set. For more information on permissions, see above How do I view/change permissions on files/directories? above. Once the file has executable permissions, simply run the filename from a terminal. I will use the filename "irc" as an example
Example: /usr/bin/irc (from anywhere on the system)
Example: ./irc (from the /usr/bin directory)
26. Were can i get an IRCClient for GNU/Linux?
Well that as anything else is at your decision.
mIRC client does not natively run in GNU/Linux but you can still run it using wine, I don't advise. Because you can found several IRCClients that run natively in your GNU/Linux, the only advice I can give is for you to start with something simple with not too much plug-in's and/or "powerful" stuff, as only if you really know what those are for and really are doing the "work" they are supposed to.
Always keep in mind, security at first.
The most used IRC clients are:
irssi - for the terminal, we have also a tutorial for this client in here
XChat - for the X windows
BitchX - for the terminal
and many more...
27. Close Up
This is very basic stuff, as you move along you can search all over the Internet for a good source of help and advises.
For example you can visit:
http://linux.oreilly.com/ - for books
http://www.linux.org/ - GNU/Linux on-line
http://www.linuxquestions.org/ - GNU/Linux help
http://www.tldp.org/ - Linux Documentation Project - a good source of native language translation tutorials.
And also even #Linux in IRCFutureNET of course, as we don't have anything more to do, we are there waiting for you. (AHAH probably not but that does not mean we can't help ;)
But very, very probably every help you need is located in "/usr/share/doc" on your system or easily accessed by typing man command or info command with the command you want to learn about, don't let yourself be taken by the "point-n-click, no learn, I'm dumb" spirit and ask dumb questions to others, as people often got tired and probably tell you to "RTFM".
And of course you can always trust in Google Linux. I hope with this I have captured your soul to bring you down into the deep spirit of Open Source.
This tutorial was written by
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
, you can find me also in #Linux.
go top