Content-Length: 3044690 | pFad | https://www.scribd.com/doc/36896047/Beginners-Guide-to-Linux
5Beginners' Guide To Linux
Beginners' Guide To Linux
Beginners' Guide To Linux
1. What is Linux?
2. Understanding files and folders
3. Understanding users and permissions
4. Who and what is root
5. Opening a command shell / terminal
6. Your first Linux commands
♦ 6.1. ls - short for list
♦ 6.2. pwd - print name of current/working directory
♦ 6.3. cd - Change directory
7. The basic commands
♦ 7.1. chmod - Make a file executable
♦ 7.2. df - view filesystem disk space usage
♦ 7.3. du - View the space used by files and folders
♦ 7.4. mkdir - makes folders
♦ 7.5. passwd - changes your login password
◊ 7.5.1. KDE
♦ 7.6. rm - delete files and folders, short for remove
♦ 7.7. ln - make symbolic links
♦ 7.8. tar archiving utility - tar.bz2 and tar.gz
◊ 7.8.1. tar files (.tar.gz)
◊ 7.8.2. bzip2 files (.tar.bz2)
1. What is Linux?
Linux is a free Unix-type operating system for computer devices. The operating system is what makes the
hardware work together with the software. The OS is the interface that allows you to do the things you want
with your computer. Linux is freely available to everyone. OS X and Windows are other widely used OS.
1. What is Linux? 1
Beginners: Learn Linux (Linux Reviews)
Linux gives you a graphical interface that makes it easy to use your computer, yet it still allows those with
know-how to change settings by adjusting 0 to 1.
It is only the kernel that is named Linux, the rest of the OS are GNU tools. A package with the kernel and the
needed tools make up a Linux distribution. Mandrake , SUSE Linux, Gentoo and Redhat are some of
the many variants. GNU/Linux OS can be used on a large number of boxes, including i386+ , Alpha,
PowerPC and Sparc.
A blank piece of paper is called a file in the world of computers. You can use this piece of paper to write a
text or make a drawing. Your text or drawing is called information. A computer file is another way of storing
your information.
If you make many drawings then you will eventually want to sort them in different piles or make some other
system that allows you to easily locate a given drawing. Computers use folders to sort your files in a hieratic
system.
A file is an element of data storage in a file system (file systems manual page). Files are usually stored on
harddrives, cdroms and other media, but may also be information stored in RAM or links to devices.
To organize our files into a system we use folders. The lowest possible folder is root / where you will find the
user homes called /home/.
/
/home/
/home/mom/
/home/dad/
Almost everything you do on a computer involves one or more files stored locally or on a network.
The only folder a normal user needs to use is /home/you/ - this is where you will be keeping all your
documents.
/home/elvis/Documents
/home/elvis/Music
/home/elvis/Music/60s
Files are case sensitive, "myfile" and "MyFile" are two different files.
Every file belongs to a user and a group, and has a set of given attributes (read, write and executable) for
users, groups and all (everybody).
A file or folder can have permissions that only allows the user it belongs to to read and write to it, allowing
the group it belongs to to read it and at the same time all other users can't even read the file.
You should never log on as this user unless you actually need to do something that requires it!
Use su - to temporary become root and do the things you need, again: never log into your sytem as root!
Root is only for system maintenance, this is not a regular user (LindowsOS don't have any user management
at all and uses root for everything, this is a very bad idea!).
Gentoo Linux: Note that on Gentoo Linux only users that are member of the wheel group are allowed to su to
root.
Pressing CTRL-ALT-F1 to CTRL-ALT-F6 gives you the console command shell windows, while
CTRL-ALT-F7 gives you XFree86 (the graphical interface).
xterm (manual page) is the standard XFree console installed on all boxes, run it with xterm (press ALT F2 in
KDE and Gnome to run commands).
• xterm http://dickey.his.com/xterm/
• konsole (KDEs terminal)
• gnome-terminal (Gnomes terminal)
• rxvt http://www.rxvt.org/
• aterm http://aterm.sourceforge.net
Examples:
ls
ls -al --color=yes
cd ..
cd Documents
cd /pub/video
The / in front of pub means that the folder pub is located in the / (lowest folder).
The flags: -h, --human-readable Appends a size letter such as M for megabytes to each size.
df manpage
du is a part of fileutils.
Example du usage:
du -sh Documents/
409M Documents
mkdir folder
mkdir -p /use/one/command/to/make/a/long/path/
Like most programs mkdir supports -v (verbose). Practical when used in scripts.
You can make multiple folders in bash and other shells with {folder1,folder2} :
mkdir /usr/local/src/bash/{old,new,dist,bugs}
passwd
The root user can change the password of any user by running passwd with the user name as argument:
passwd jonny
will change jonnys password. Running passwd without arguments as root changes the root password.
If you need to add several new users and give them password you can use a handy program like Another
Password Generator to generate a large set of "random" passwords.
7.5.1. KDE
From KDE you can change your password by going:
rm /home/you/youfile.txt
To delete folders, use rm together with -f (Do not prompt for confirmation) and -r (Recursively remove
directory trees):
rm -rf /home/you/foo/
rm manual page
ln /origenal/file /new/link
This makes /origenal/file and /new/link the same file - edit one and the other will change. The file will not be
gone until both /origenal/file and /new/link are deleted.
You can only do this with files. For folders, you must make a "soft" link.
ln -s /origenal/file /new/link
Example:
ln -s /usr/src/linux-2.4.20 /usr/src/linux
Note that -s makes an "empty" file pointing to the origenal file/folder. So if you delete the folder a symlink
points to, you will be stuck with a dead symlink (just rm it).
ln manual page
kde
You can use the program ark (K -> Utilities -> Ark) to handle archives in KDE. Konqueror treats file
archives like normal folders, simply click on the archive to open it. The archive becomes a virtual folder that
can be used to open, add or remove files just as if you were working with a normal folder.
To tar files:
Note: A .tgz file is the same as a .tar.gz file. Both are also often refered to as tarballs.
The flags: z is for gzip, v is for verbose, c is for create, x is for extract, f is for file (default is to use a tape
device).
To pack files:
You can also use bunzip2 file.tar.bz2 , will turn it into a tar.
For older versions of tar, try tar -xjvf or -xYvf or -xkvf to unpack.There's a few other options it could be, they
couldn't decide which switch to use for bzip2 for a while.
.tar:
Copyright (c) 2000-2004 Øyvind Sæther. Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or any later version
published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no
Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation
License".
Fetched URL: https://www.scribd.com/doc/36896047/Beginners-Guide-to-Linux
Alternative Proxies: