1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Tài liệu Tìm hiểu Linux doc

41 266 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Exploring the Linux Filesystem
Người hướng dẫn MS. Võ Minh Sơn
Định dạng
Số trang 41
Dung lượng 1,54 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

1.1 Overview1.2 Filesystem hierarchy 1.3 Type of information 1.4 Linux device files 1.5 Mounting and unmounting a device on thefilesystem 3...  Physical storage device: HDD, DVD-ROM se

Trang 1

MS Võ Minh Sơn

Students:

Nguyễn Đức Tiến 0620076 Nguyễn Xuân Thuận 0620069

Trang 3

1.1 Overview

1.2 Filesystem hierarchy

1.3 Type of information

1.4 Linux device files

1.5 Mounting and unmounting a device on thefilesystem

3

Trang 4

Physical storage device: HDD, DVD-ROM 

sector, track, cylinder

• HDDs can be divided into separate storage

devices called partitions

A filesystem is the methods and data

structures that an operating system uses to keep track of files on a disk or partition (the way the files are organized on the disk)

ext3 (third extended filesystem)

Trang 6

File properties (Administrative information)

File manager KDEKonqueror

(Windows Explorer) GNOME Nautilus

Trang 7

7

Trang 10

Data files

Link filesDirectory filesConfiguration files

Device files

Type of information

 Application-specific files

o Program Applications

o Image files

 Text files

Trang 11

11

Trang 12

 Linux treats all devices as files and uses a device just as it uses a file

Open file Write file

Read file

Close file

Device Driver: a special program that

controls a particular type of hardware

 Any application can access a device by opening the file specific to that device

Trang 13

Device file: the file which applications use to

access a device

These special appear in the /dev directory in

the Linux filesystem

block devices  „b‟

character devices  „c‟

network devices  „ethx‟/„pppx‟ ( x = 0, 1, )

13

Trang 14

 Each of storage device has own filesystem

• when you want to add a new storage device, you need to format it as a filesystem and then attach it to your Linux file structure

Mounting is the operation you perform to

cause the filesystem on a physical storage device to appear as part of the Linux filesystem

Mounting point is a specified directory that contains the mount command to mount a

device on the Linux filesystem

Trang 15

Mounting a device on the filesystem

Trang 16

 Example

fd 0: the first floppy drive attached to your system

sd a 2: the second partition on the first SCSI hard drive

hd IDE hard drive

1 – 4 are primary partitions

5 and up are logical partitions

sd SCSI hard drives

fd Floppy disks

lp Printer ports

cdrom Links to your CD-ROM device file

Trang 19

3 File Permissions

Three types of user accounts

Owner The account that owns the file

Group Members of a group that owns the file

All users All accounts on the system

Do one or more of three things to the file

Read (r) Look at the contents of the file

Write (w) Save the file to the hard disk

Execute (x) Run the file or enter the directory

 Example: drwxr-x

Trang 20

r 3 File Permissions (cont)

Format:

chmod who action permission filename

Example: chmod u+x nguyen.txt

Trang 21

4 File processing

4.1 Finding file

4.2 Creating Directories, Files, and Links4.3 Copying, Renaming, and Moving Files4.4 Viewing and Editing Text Files

4.5 Deleting Files and Directories

4.6 Backup and restoring files

Trang 23

4.1.1 Find command

find pathname conditions

Trang 24

4.1.2 Grep command

grep options pattern files

Trang 25

4.2 Creating Directories, Files, and Links

 To create a directory in any directory where you have write permission, use the mkdir

command:

mkdir path/dirname

 If path includes directories don't yet exist, you can create them in one command with the -p option:

mkdir -p /usr/local/newparent/mydir

Trang 26

4.2 Creating Directories, Files, and Links (cont)

 Files can be created by applications, such as

a word processor, and cat command

 Links can be created at the command line using the ln command

Trang 27

4.3 Copying, Renaming, and Moving Files

To copy or move a file, type:

(moves a file or directory)

Your account needs to have write permissions

Trang 28

4.4 Viewing and Editing Text Files

 Applications: Kate, Kwrite, …

 Command lines:

•cat filename: The entire file contents display

on the screen at once

•less filename: display the contents one

screen at a time

•vi filename: edit file

Trang 29

Vi options

Trang 30

Vi options (cont)

Trang 32

ZZ: save file

:q!: close without saving file

Vi options (cont)

Trang 33

4.5 Deleting Files and Directories

 rm filename: delete a file

 rm *: delete all file in current directory

 rmdir dirname: remove a empty directory

 rm -r dirname: remove a directory

 Must have write permissions on the directory containing the files

Trang 34

 +which files needing to back up

+how often

+what back up storage to use

Back up strategyBack up media

tap archiver command (tar)

 Format: tar options tarfile filelist

Trang 35

Tar options

Trang 36

Tar options (cont)

Trang 40

1. Spring into Linux (AW), 2005

2. Linux All-In-One Desk Reference For

Ngày đăng: 22/12/2013, 21:17

TỪ KHÓA LIÊN QUAN

w