33
10/1/2012 1  Contents Linux History nux e up Linux Command Linux Network configuration

7 VSS SI001 E1 1 Linux Basic 66p

Embed Size (px)

Citation preview

Page 1: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 1/33

10/1/20

 

Contents

Linux History

nux e up

Linux Command

Linux Network configuration

Page 2: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 2/33

10/1/20

What is Linux

UNIX POSIX

MINIX

GNUINTER

NET

LINUX

Linux history

UNIX Minix Linux

Richard.StallmanDennis.Ritchie

Ken.Thompson Andrews.Tanenbaum 

Page 3: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 3/33

10/1/20

Linux composed

Linux composed:

kernel 

Shell

File structure

programs

 

Linux Distribution version Companies and organizations package the kernel with the

GNU utilities, their own installation procedure and,

documentation, and sometimes proprietary (non opensource) products. This set is called a "distribution".

Do you know the following Linux distribution?

Page 4: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 4/33

10/1/20

Linux used in VSS

SuSe Linux - formerly a German company with a strongU.S. presence, has been purchased by networking leader

. , ,pioneered mainframe Linux with IBM and has beenselected by Sun Microsystems for their Linux desktopprogram.

Contents

Linux History

 

Linux Command

Linux Network configuration

Page 5: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 5/33

10/1/20

Linux setup

Before setup

harddisk,video adapter,sound card,networkadapter,monitor

Partition

 / ext2/ext3 2~4G

swap swap

cd,hard disk,ftp

Linux file system The Second Extended(ext2) file system

ext2 was devised as an extensible and powerful file system for

Linux. It is also the most successful file s stem so far in the Linux community and is the basis for all of the currently shipping Linux

distributions.;

The Third Extended(ext3) file system

ext3 provides stronger data integrity in the event that an uncleansystem shutdown occurs. ext3 allows you to choose the type and

level of protection that your data receives.

 ext3's journaling optimizes hard drive head motion.

Page 6: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 6/33

10/1/20

Linux partition

IDE device: /dev/hdx

SCSI device: /dev/sdx

At best 4 primary partitions hda1,2,3,4

Logic partitions from hda5

Linux vs Windows

hda1Primarypartition hda1 C:

Primarypartition

hda2

hda3

hda5

Primarypartition

Primarypartition

hda2extended artition

hda5 (D:)

hda6 (E:)

hda7 F:

hda6

hda7

hda4extended partition

Page 7: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 7/33

10/1/20

Suse Linux setup

Suse Linux setup

Page 8: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 8/33

Page 9: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 9/33

10/1/20

Suse Linux setup

Suse Linux setup

Page 10: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 10/33

10/1/20

Suse Linux setup

Suse Linux setup

Page 11: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 11/33

10/1/20

Suse Linux setup

Suse Linux setup

Page 12: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 12/33

10/1/20

Suse Linux setup

Suse Linux setup

Page 13: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 13/33

10/1/20

Suse Linux setup

Suse Linux setup

Page 14: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 14/33

10/1/20

Suse Linux setup

Suse Linux setup-IP configuration

Page 15: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 15/33

10/1/20

Suse Linux setup-IP configuration

Suse Linux setup-IP configuration

Page 16: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 16/33

10/1/20

Suse Linux setup-IP configuration

Suse Linux setup-IP configuration

Page 17: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 17/33

10/1/20

Suse Linux setup-IP configuration

Suse Linux setup-IP configuration

Page 18: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 18/33

10/1/20

Suse Linux setup-IP configuration

Suse Linux setup-configure NTP client

Page 19: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 19/33

10/1/20

Suse Linux setup-configure NTP client

Suse Linux setup-configure NTP client

Page 20: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 20/33

10/1/20

2

Contents

Linux History

 

Linux Command

Linux Network configuration

Graphical & text interface

Linux provide 6 text login terminal:

Ctrl+Alt+[F1]~[F6]:tty1~tty6

Ctrl+Alt+[F7] : graphical

Exchanged from text to Graphical:

# startx

2 methods to login text terminal:

#init 3;

Vi /etc/inittab;modify “id:5:initdefault” to“id:3:initdefault”,in this way, the server will start fromtext for ever.

Page 21: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 21/33

10/1/20

2

Linux command

In Shell,Linux command usage:

command [OPTION]...

Pay attention:

cd and CD is not the same command.

Turbo Linux command is different from Suse Linuxcommand

Linux basic commands

ls

Usage: ls [OPTION]... [FILE]...

List information about the FILEs

-a, --all do not hide entries starting with .

-l use a long listing format, list one fileper line

cd

sage: c - - r Change the current directory to dir.

#cd /home

Page 22: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 22/33

10/1/20

2

Linux basic commands

who Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]

who - show who is logged on

-m only hostname and user associated with stdin

-b, --boot time of last system boot

#who ;show all the user who is logged in

#who am i;only show the local user detail

w oam ;on y s ow e oca user name

Linux basic commands

Date

Usage: date [OPTION]... [+FORMAT]

or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

Display the current time in the given FORMAT, or setthe system date.

Page 23: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 23/33

10/1/20

2

Linux basic commands

passwd:

Usage: passwd [OPTION...] <accountName>

Passwd is used to update a user's authenticationtoken(s)

--usage Display brief usage message

Remember the following two principles

Protect your password. Don't write down your password -

memorize it.

Choose a hard-to-guess password. passwd will try to preventyou from choosing a really bad password, but it isn't foolproof;

create your password wisely.

Linux basic commands

pwd:

pwd show the current user path

#pwd

clear:

clear clear the terminal screen

#clear

Page 24: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 24/33

Page 25: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 25/33

10/1/20

2

Linux basic commands

rm:

Remove (unlink) the FILE(s).

rm [OPTION]... FILE...

-d, --directory unlink FILE, even if it is a non-emptydirectory

-f, --force ignore nonexistent files, never prompt

-i, --interactive prompt before any removal

– 

Linux basic commands

mv:

mv - move (rename) files

mv [OPTION]... SOURCE DEST

mv [OPTION]... SOURCE... DIRECTORY

mv [OPTION]... --target-directory=DIRECTORYSOURCE...

-f --force do not rom t before overwritin 

-i, --interactive prompt before overwrite

Page 26: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 26/33

10/1/20

2

Linux basic commands

cp- copy files and directories cp cp [OPTION]... SOURCE DEST

... ...

cp [OPTION]... --target-directory=DIRECTORYSOURCE...

DESCRIPTION

copy SOURCE to DEST, or multiple SOURCE(s) toDIRECTORY.

- , -- if an existing destination file cannot be opened, remove it and

try again -i, --interactive

prompt before overwrite

Linux basic commands cat:

cat - concatenate files and print on the standard output

...:

-n, --number number all output lines

tail: tail - output the last part of files

print the last 10 lines of each FILE to standard output.

ta ... ... -n, --lines=N

output the last N lines, instead of the last 10

Page 27: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 27/33

10/1/20

2

Linux basic commands

more:

more - file perusal filter for crt viewing

more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file ...]

+num Start at line number num.

#cat filename|more

less

less - opposite of more

Less is a program similar to more (1), but which allowsbackward movement in the file as well as forwardmovement.

Linux basic commands

chmod:

chmod - change file access permissions

chmod [OPTION]... MODE[,MODE]... FILE...

chmod [OPTION]... OCTAL-MODE FILE...

chmod [OPTION]... --reference=RFILE FILE...

rwx rwx rwxowner group others

- ---111 101 0007 5 0

-R, --recursive

change files and directories recursively

Page 28: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 28/33

10/1/20

2

Linux basic commands

chown:

chown - change file owner and group

chown [OPTION]... OWNER[:[GROUP]] FILE...

chown [OPTION]... :GROUP FILE...

chown [OPTION]... --reference=RFILE FILE...

-R, --recursive change files and directoriesrecursively

Linux basic commands

su

su - run a shell with substitute user and group IDs

su [OPTION]... [-] [USER [ARG]...]

Page 29: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 29/33

10/1/20

2

Linux advanced commands

tar:

tar - saves many files together into a single tape or diskarc ve, an can res ore n v ua es rom earchive.

tar -cf archive.tar foo bar # Create archive.tar from filesfoo and bar.

tar -tvf archive.tar # List all files in archive.tarverbosely.

tar -xf archive.tar # Extract all files from archive.tar.

tar cvf file.tar filelist

Linux advanced commands ftp:

ftp - Internet file transfer program ft hostname

ascii ;

bin ;

get ;

put ;

ls ;

? ;

qu ;

Page 30: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 30/33

10/1/20

3

Linux advanced commands

shutdown:

shutdown –ry 0 ;Reboot after shutdown.

shutdown –hy 0 ;halt after shutdown

reboot ;

The VI (visual interface ) Editor

vi provides three operating modes.

In command mode keys are interpreted as commande emen s. nser mo e n erpre s a eys as ex en r es.Last line mode is used for more complex commands,which are entered in the last line.

Page 31: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 31/33

10/1/20

3

Simple Commands of the vi Editor

ESC Changes to last line mode.

Changes to insert mode (characters appear at the current

cursor osition .

Changes to insert mode (characters appear after the

current cursor position).

Changes to insert mode (characters are added at the end

of the line).

Changes to command mode (overwrites the old text).

  .

Changes to insert mode (the character where the cursor is

positioned is replaced by the next entry you make).

Changes to insert mode (the rest of the line is replaced by

the new text).

Simple Commands of the vi EditorChanges to insert mode (a new line is inserted after the current one).

Changes to insert mode (a new line is inserted before the current one).

Deletes the current character.

Deletes the current line.

Deletes up to the end of the current word.

Changes to insert mode (the rest of the current word is overwritten by

the next entries you make).

Undoes the last command.

Joins the following line with the current one.

Repeats the last command.

Changes to last line mode.

Page 32: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 32/33

10/1/20

3

Complex Commands of the vi Editor

exits vi without saving any changes

saves as filename 

saves the modified file and exits the

editor

edits (loads) filename 

undoes the last edit command

Contents

Linux History

 

Linux Command

Linux Network configuration

Page 33: 7 VSS SI001 E1 1 Linux Basic 66p

7/31/2019 7 VSS SI001 E1 1 Linux Basic 66p

http://slidepdf.com/reader/full/7-vss-si001-e1-1-linux-basic-66p 33/33

10/1/20

Network configuration

# arp -a

# ping <IP-Address>

# ifconfig eth0

# ifconfig eth0 up