Professional Documents
Culture Documents
There are many distributions to choose from Only a few distributions are widely deployed (see: linux.org and
distrowatch.com) The code for Linux and the GNU utilities is open source so there is no charge for the code itselfbut depending on the distribution h f h d lf b d d h d b and packaging, media, and support, you may have to pay. Distributions Distributions:
Debian (debian.org) Red Hat Fedora (fedora.redhat.com) ( ) Mandrake (mandrakelinux.com) Ubuntu (ubuntu.com) [this is what we have in lab] SuSE (suse.com)
2
Disclaimer: Some of the slides have been adapted from the course textbook
TruboLinux (turbolinux.com),
Virtual Machine
If you use a virtual machine (vmware.com) you can run Linux from within
Windows.
Desktop environments
In addition to X Window you need a desktop environment Window, Provides the interfaces that a person uses like icons, menus, toolbars
dual-boot
Th most likely option is to install Li The lik l i i i ll Linux alongside windows (d l b ) [ hi is what l id i d (dual-boot) [this i h
GNOME (GNU Object Model Environment) [well use this] ( j )[ ] Simple and elegant KDE (the K Desktop Environment) Complex and flexible
3
Disk partitioning
A disk partition is an area of the disk that is treated as a separate unit The most intimidating step of the installation process, especially if you want to
If you have a second disk drive not currently used by Windows, use that for Linux
Other Details
If you plan to dual-boot windows partitions can be mounted and dual-boot,
read by Linux (mount as read-only so they are not accidently a te e ) altered) Boot loaders
Load windows when the system is booted Loads the kernel and Linux boots up Two options but they do the same job The original LILO (the Linux Loader) The recent GRUB (GNU Grand Unified Boot loader)
The $ or % prompt that you see when you first log in or start a
Boot floppy
Create one during installation. It can be used to boot Linux in case of
5
terminal window is displayed by the shell p y y The shell is a program that acts as a middleman between you and the Linux operating system ( lets you run p g p g y (it y programs and work with files) f ) The three most popular shells are (and each has its own p g programming language): g g g )
The Bourne Again shell (bash) The Korn shell (ksh)
6
By default, all three I/O channels are the terminal Special characters
Some characters are interpreted specially Known as metacharacters (Ctrl-D Ctrl-C etc) (Ctrl-D, Ctrl-C, Can be listed using the stty command
7
directories ok) Current directory (represented by .) and parent directory (..) Absolute pathname: relative to the root (/) directory Relative pathname: relative to the current working directory
10
current working directory When you log into Linux your shell starts at your home directory Linux, your directory Every user has a different home directory (may begin with /home) The system administrator assigns these home directory values The pwd command is used to display your shells current working directory y
cat
Takes input from standard input or list of files and displays them to p p p y
directory in alphabetical order, excluding filename that start with a period (hidden files) With -a for all files including hidden files l f long f -l for l format (including owner, size, date of last modification) l d d fl df -R recursively lists the contents of a directory and its subdirectories S example of l See l f long li i on the next slide listing h lid
Listing contents of a file
Use the cat command for small files (doesnt pause between screens) Use the more command for large files U head n f l to d l the f Use h d file display h first n l lines of f l (d f l is 10 l ) f file (default lines)
12
standard output (default input is keyboard, default output is screen) Standard output can be sent to a file using output redirection >. If file doesnt exist it is created, otherwise its contents are overwritten 11 cat is short for concatenate (to connect in a series of links)
Use tail n file to display the last n lines of file (default is 10 lines)
confirmation Can also b used to move a f l or a collection of f l to a d l be d file ll f files directory And it can be used to move an entire directory (renames it)
mkdir
Creates a directory (if a directory already exists, an error message id
displayed) di l d)
cd
Ch Changes (or moves to) a d ( ) directory If no directory name is provided, the shell is moved to its owners home
length; may contain any printable character except the slash (/); and there is no requirement for file extension
directory
14
Syntax:
#mv i oldFileName newFileName #mv -i {filename}* directoryName {f } y #mv -i oldDirectoryName newDirectoryName
rmdir
Removes one or more directories A directory must be empty before it can be removed To recursively remove a directory and all of its contents, use the -r
mv is a fast track that j f just remane the f ( dir) but file (or )
not move the contents of a file (or a dir). The i is for confirmation if that file (dir) already exists f f f f ( ) y
option
rm
Removes a file from the directory hierarchy rm with the -r option removes a directory and all of its contents
15
16
Syntax:
#cp -i oldFileName newFileName # cp -ir {filename}* directoryName p {f } y
lpstat)
lpr/lpq/lprm p pq p
BSD Unix provides its own print commands, which are also supported by
17
newfilename where I want to keep the oldfilename . The sencond form of cp copies a list of files into directoryname The -i is for confirmation if that file (dir) already exists The -r option causes any source files that are directories to be recursively copied, i.e. coping the entire directory.
respectively
18
File Permissions
User group everyone else: User, group,
groups
Each user is a member of one or more groups on the system The groups command with no arguments, displays a list of all the
g p groups that you are a member of (groups userID to display a list of y (g p p y that users groups)
chgrp gp
Changes the group of files you own This utility is seldom used by normal users ( y y (unless youre member of y
several groups
chown
19
20
21
22
File Permissions
Memorizing the hard way way
File Permissions
Premissions
The easy way 0 = 1=x 2=w 3 3=wx 4=r 5=rx 6=rw 7=rwx
Premission
23
24
25