Sie sind auf Seite 1von 28

Linux using Redhat 9.

0
Faculty: R. Balamurugan (Redhat/Microsoft Certified)
Why do you want to learn Linux?
Introduction
Linux is an Operating System like DOS, Windows, MAC OS (Apple) , UNIX (Solaris,
HP-UX, IBM-AIX)

screen
Linux <-> UNIX
Similarities:
Architecture
POSIX (Portable Operating System Interface
for Computing Environments) standard
Proprietary vs Opensource
Proprietary
- Companies decide what the user wants.
- New features/Bug fixes based on company priorities.

e.g.
Microsoft Automatic updates restart prompt
Multiple tabs in browser
Centralized repository of softwares with automatic download verification
Proprietary vs Opensource
Opensource:
+ User knows what he wants.
+ New features added at a rapid pace, which is again user driven.

e.g Most distribution release new versions every 4-5 months, unlike Proprietry release
cycle of many years.
- Geared towards the Power user. Recently Linux distributions like Ubuntu, Intel
Moblin, Google Andriod trying to change this.
- Difficult for a new user to get used to different interface.

e.g DOS/Windows GUI, Windows XP/Win7, etc
Redhat/Ubuntu/Debian/Fedora ?
What are Redhat/Ubuntu/Fedora/etc
Community based development
Kernel: core of the operating system -
kernel.org (Linus Torvalds)
GNOME/KDE/twm/Xfce-Graphical Mangers
(many group of voluteers)
Openoffice/Koffice/Abiword-Office application
(many group of voluteers)
Redhat/Ubuntu/Fedora
(packaging/testing/support)
http://distrowatch.com
Getting Started
Basics
Booting
X Login/GUI Login
Command Line Interface (CLI)
Virtual consoles
Linux File System
Files/Folders
arranged under
multiple trees (A:, C:,
D:,) <img>
File/Folder names are
case-insensitive. e.g.
MAIL, Mail, mAIL are
all same files
Paths are separated
by '\' e.g. C:\Windows
.. refers to the parent
directory
. refers to the current
directory
Everything is under /
(/mnt/floppy, /home,
/usr/lib/include)
</img>
File/Folder names are
case-sensitive. e.g.
MAIL, Mail, mAIL are
all different files
Paths are separated
by '/' e.g. /var/log
.. refers to the parent
directory
. refers to the current
directory
File/Folder naming
Names upto 255 characters
All characters except '/' are valid, but good to
avoid special characters
Important Directories
Home directories: /home/student, /home/guest,
/root
Commands/Programs available for all users:
/bin
Commands/Programs available for root
(administrator) user: /sbin
Mount points for external media: /mnt
(/mnt/floppy, /mnt/cdrom)
System configuration files: /etc
Temporary files: /tmp
OS kernel and bootloader files: /boot
Variable(Misc) files: /var
System Information: /proc (it is virtual folder
represent the RAM, not stored on harddisk)
Library(DLL) files: /lib
Basic Commands
Basic Commands
echo
$ echo "Hello world"
cal
$ cal 2009
$ cal 1 2009
bc
$ bc (this will give an interactive prompt)
$ echo 10 + 20 | bc l
cont...
banner
$ banner hello
lpr
$ lpr file.txt
date
$ date
$ date -s Jan 1 2010
Getting Help
whatis
$ whatis bc
man
$ man lpr
whereis
$ whereis cal
http://tldp.org
File/Folder operations
ls
$ ls
$ ls -a (display hidden files)
$ ls -a -l /home/student
$ ls -al /home/student
file (show the file type)
$ file somefile.txt
touch
touch new.txt
cont...
mkdir
$ mkdir /home/student/myname
cd
$ cd ..
pwd (present working directory)
$ pwd
cont...
cp (copy)
$ cp old.txt oldcopy.txt
$ cp -r folder1 folder2
mv (move / rename)
$ mv a.txt b.txt
$ mv b.txt /home/student/
rm (delete)
$ rm a.txt
$ rm -r folder2
rmdir (delete empty folders only)
$ rmdir somefolder
cont...
cat (dump/show content of file)
$ cat notes.txt
tac (same as cat but in reverse order)
$ tac notes.txt
more (see text screen-by-screen)
$ more notes.txt
head (first 10 lines)
$ head notes.txt
tail (last 10 lines)
$ tail notes.txt
Search files/folders
locate (search in database)
$ locate notes.txt
updatedb
$ updatedb
find
$ find /home/student -name '*.txt'
Archiving/Compressing
How to use winzip-like functionality in Linux i.e
store multiple files in a single compressed .zip
file
Old style (2 steps)
Store multiple files in a single archive file
Compress the archive file
New style (1 step)
Store multiple files and compress them at the
same time
Old style (still valid)
Store multiple files/folder
tar
$ tar -cf backup.tar a.txt /home (store)
$ tar -xf backup.tar (extract)
$ tar -tf backup.tar (see contents)

cont...
zip/unzip (compression=less, speed=fast)
$ zip backup.zip backup.tar (creates
compresed file backup.zip)
$ unzip backup.zip (uncompress)
$ zip Readme.zip Readme.txt
$ unzip Readme.zip
cont...
gzip/gunzip (compress=medium,
speed=medium)
$ gzip backup.tar (creates compressed file
backup.tar.gz
$ gunzip backup.tar.gz (uncompress)
cont...
bzip2/bunzip2 (compress=most, speed=low)
$ bzip2 backup.tar (creates compressed file
backup.tar.bz2 )
$ bunzip2 backup.tar.bz2 (uncompress)
New style
Combine and compress in single command
$ tar -czf backup.tar.gz /var a.txt (gzip)
$ tar -cjf backup.tar.bz2 /var b.txt (bzip2)
Uncompress and extract in single command
$ tar -xzf backup.tar.gz
$ tar -xjf backup.tar.bz2
zcat
Used to display compressed files
$ gzip a.txt
$ zcat a.txt.gz

Das könnte Ihnen auch gefallen