SlideShare a Scribd company logo
1 of 13
Download to read offline
Trường Đại học Công nghệ Thông tin – ĐHQG TP.HCM
           Khoa Mạng máy tính và Truyền thông
                       -----0-0-----


                 Nhóm Open-Class

                        Bài 2:

         Cấu trúc file trên Linux

                                           G.V: Nguyễn Hải Long
                                       LongNH@uitnetwork.com

1
Nội dung bài học

  Cấu trúc file trên linux

  Ext3 file system

  Loại tập tin và các dạng liên kết

  Thao tác với hệ thống tập tin

  Phân quyền cho hệ thống tập tin


                                       2
Cấu trúc file trên Linux




                           3
Cấu trúc file trên Linux (tt)
   /boot     kernel và cấu hình boot
   /bin      các lệnh cơ bản
   /dev      khai báo thiết bị
   /etc      cấu hình hệ thống và các ứng dụng
   /home     thư mục lưu dữ liệu người dùng
   /lib      thư viện dùng chung
   /mnt or /media thư mục mount CD, USB …
   /proc     thông tin process
   /sbin     các lệnh quản trị
   /tmp      dữ liệu tạm
   /var      dữ liệu biến động
   /usr      ứng dụng và thư viện
                                                  4
Ext3 file system




 Inode đại diện cho file bao gồm thuộc tính
 (Attributes) và con trỏ (Pointer)



                                               5
Ext3 file system



 Lệnh fdisk      xem, tạo, xóa partition.
 Lệnh fsck chẩn đoán và sửa lỗi file systems.
 Lệnh mount     Ánh xạ một partion vào cây thư mục



                                                      6
Các loại tập tin và dạng liên kết




                                    7
Các ký tự đặc biệt
 Các câu lệnh trong linux phân biệt chữ in hoa và in
    thường

 Ký tự chuyển hướng dòng lệnh
   > và >> chuyển hướng đầu ra cho dòng lệnh
   < chuyển hướng đầu vào cho dòng lệnh
   ; thực hiện lệnh một cách tuần tự
   && thực hiện lệnh sau khi lệnh trước thành công
   | kết quả lệnh trước làm đầu vào cho lệnh sau


                                                        8
Các lệnh với file
   mkdir   tạo thư mục
   cp      copy file (muốn copy cả thư mục thêm -r)
   mv      di chuyển, hoặc đổi tên thư mục
   rm      xoá bỏ các file trong thư mục (-r xoá tất cả)
   rmdir   xoá thư mục rỗng
   ls      xem thông tin các tập tin
   find    tìm kiếm tập tin theo mô tả
   split   chia nhỏ tập tin
   cat     tạo tập tin
   ln      tạo liên kết đến file (softlink hoặc hardlink)
                                                             9
Các lệnh với file (tt)
 cmp        so sánh 2 tập tin nếu khác nhau thì đưa ra
  số dòng và byte khác nhau
 diff       so sánh 2 tập tin và in ra các dòng khác
  nhau
 patch      so sánh 2 tập tin và in file mới nhất




                                                          10
Bảo mật hệ thống file
 Các câu lệnh phân quyền và gán quyền
   chown         gán quyền sở hữu cho nhóm
   chmod         gán quyền cho file hoặc thư mục
   unmask        gán quyền cho thư mục và các file con




                                                          11
Bài tập thực hành
1. Tạo thư mục /data và gán quyền 775 cho thư mục này
2. Copy tất cả các file trong thư mục ~ vào thư mục /data.
   So sánh quyền truy cập của các file trong thư mục ~ và
   /data
3. Tạo tập tin baitap3.txt trong thư mục /data. Kiểm tra
   quyền của file này. Hãy thiết lập sao cho các file và thư
   mục trong thư mục /data đều có quyền 755.
4. Mount file CentOS-5.5.iso vào thư mục /mnt/VirtualCD.
   Cắt nối file film 1.5GB khi có USB 1GB
5. Chép 25 tập film (mỗi tập khoảng 300MB) vào usb 1GB

                                                               12
Q&A




      13

More Related Content

What's hot

Improving notes addressing experience with recent contacts
Improving notes addressing experience with recent contactsImproving notes addressing experience with recent contacts
Improving notes addressing experience with recent contactsVinayak Tavargeri
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Ahmed El-Arabawy
 
Hệ điều hành linux (1)
Hệ điều hành linux (1)Hệ điều hành linux (1)
Hệ điều hành linux (1)khung196
 
O Mundo Do Mainframe
O Mundo Do MainframeO Mundo Do Mainframe
O Mundo Do Mainframelui_fp
 
BIOS, Linux and Firmware Test Suite in-between
BIOS, Linux and  Firmware Test Suite in-betweenBIOS, Linux and  Firmware Test Suite in-between
BIOS, Linux and Firmware Test Suite in-betweenAlex Hung
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Linux programming lecture_notes
Linux programming lecture_notesLinux programming lecture_notes
Linux programming lecture_notesIMRAN KHAN
 
Processos threads senai
Processos threads senaiProcessos threads senai
Processos threads senaiCarlos Melo
 
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ..."Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...Edge AI and Vision Alliance
 
MPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumMPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumJeff Squyres
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Configurando as ferramentas do Windows Server 2008
Configurando as ferramentas do Windows Server 2008Configurando as ferramentas do Windows Server 2008
Configurando as ferramentas do Windows Server 2008Guilherme Lima
 
Dynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to ConsumptionDynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to ConsumptionAlpen-Adria-Universität
 

What's hot (20)

Improving notes addressing experience with recent contacts
Improving notes addressing experience with recent contactsImproving notes addressing experience with recent contacts
Improving notes addressing experience with recent contacts
 
Nfs
NfsNfs
Nfs
 
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts) Course 102: Lecture 20: Networking In Linux (Basic Concepts)
Course 102: Lecture 20: Networking In Linux (Basic Concepts)
 
Hệ điều hành linux (1)
Hệ điều hành linux (1)Hệ điều hành linux (1)
Hệ điều hành linux (1)
 
Đề tài: Nghiên cứu và triển khai hệ thống Windown Server 2012
Đề tài: Nghiên cứu và triển khai hệ thống Windown Server 2012Đề tài: Nghiên cứu và triển khai hệ thống Windown Server 2012
Đề tài: Nghiên cứu và triển khai hệ thống Windown Server 2012
 
O Mundo Do Mainframe
O Mundo Do MainframeO Mundo Do Mainframe
O Mundo Do Mainframe
 
BIOS, Linux and Firmware Test Suite in-between
BIOS, Linux and  Firmware Test Suite in-betweenBIOS, Linux and  Firmware Test Suite in-between
BIOS, Linux and Firmware Test Suite in-between
 
Hệ Thống DNS
Hệ Thống DNSHệ Thống DNS
Hệ Thống DNS
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Linux programming lecture_notes
Linux programming lecture_notesLinux programming lecture_notes
Linux programming lecture_notes
 
Processos threads senai
Processos threads senaiProcessos threads senai
Processos threads senai
 
Apresentacao Suse
Apresentacao SuseApresentacao Suse
Apresentacao Suse
 
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ..."Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
 
MPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumMPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI Forum
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Computação em Nuvem
Computação em NuvemComputação em Nuvem
Computação em Nuvem
 
Configurando as ferramentas do Windows Server 2008
Configurando as ferramentas do Windows Server 2008Configurando as ferramentas do Windows Server 2008
Configurando as ferramentas do Windows Server 2008
 
Dynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to ConsumptionDynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
Dynamic Adaptive Streaming over HTTP: From Content Creation to Consumption
 

Viewers also liked

Lesson 6 - Administering Linux System (2)
Lesson 6 - Administering Linux System (2)Lesson 6 - Administering Linux System (2)
Lesson 6 - Administering Linux System (2)Thang Man
 
Lesson 8 - Reviewing Basic Networking
Lesson 8 - Reviewing Basic NetworkingLesson 8 - Reviewing Basic Networking
Lesson 8 - Reviewing Basic NetworkingThang Man
 
Lesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line EnvironmentLesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line EnvironmentThang Man
 
Tìm hiểu về Linux
Tìm hiểu về LinuxTìm hiểu về Linux
Tìm hiểu về LinuxNhan Nguyen
 
Lesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell ProgrammingLesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell ProgrammingThang Man
 
Lesson 1 - Introduction to Open Source & Linux
Lesson 1 - Introduction to Open Source & LinuxLesson 1 - Introduction to Open Source & Linux
Lesson 1 - Introduction to Open Source & LinuxThang Man
 
Lesson 5 - Administering Linux System (1)
Lesson 5 - Administering Linux System (1)Lesson 5 - Administering Linux System (1)
Lesson 5 - Administering Linux System (1)Thang Man
 

Viewers also liked (7)

Lesson 6 - Administering Linux System (2)
Lesson 6 - Administering Linux System (2)Lesson 6 - Administering Linux System (2)
Lesson 6 - Administering Linux System (2)
 
Lesson 8 - Reviewing Basic Networking
Lesson 8 - Reviewing Basic NetworkingLesson 8 - Reviewing Basic Networking
Lesson 8 - Reviewing Basic Networking
 
Lesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line EnvironmentLesson 2 - Install Linux & Command Line Environment
Lesson 2 - Install Linux & Command Line Environment
 
Tìm hiểu về Linux
Tìm hiểu về LinuxTìm hiểu về Linux
Tìm hiểu về Linux
 
Lesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell ProgrammingLesson 7 - Linux Shell Programming
Lesson 7 - Linux Shell Programming
 
Lesson 1 - Introduction to Open Source & Linux
Lesson 1 - Introduction to Open Source & LinuxLesson 1 - Introduction to Open Source & Linux
Lesson 1 - Introduction to Open Source & Linux
 
Lesson 5 - Administering Linux System (1)
Lesson 5 - Administering Linux System (1)Lesson 5 - Administering Linux System (1)
Lesson 5 - Administering Linux System (1)
 

Similar to Lesson 3 - Linux File System

Similar to Lesson 3 - Linux File System (20)

Chuong 03 he_thong_file
Chuong 03 he_thong_fileChuong 03 he_thong_file
Chuong 03 he_thong_file
 
3 he thong-file
3 he thong-file3 he thong-file
3 he thong-file
 
3 he thong-file
3 he thong-file3 he thong-file
3 he thong-file
 
3 he thong-file
3 he thong-file3 he thong-file
3 he thong-file
 
tài liệu Mã nguồn mở 03 he-thong-tep-linux-14
tài liệu Mã nguồn mở  03 he-thong-tep-linux-14tài liệu Mã nguồn mở  03 he-thong-tep-linux-14
tài liệu Mã nguồn mở 03 he-thong-tep-linux-14
 
Linux+02
Linux+02Linux+02
Linux+02
 
Linux security
Linux securityLinux security
Linux security
 
Hệ thống tệp Linux
Hệ thống tệp LinuxHệ thống tệp Linux
Hệ thống tệp Linux
 
Linux và mã nguồn mở
Linux và mã nguồn mởLinux và mã nguồn mở
Linux và mã nguồn mở
 
Linux04 hethongtaptin
Linux04 hethongtaptinLinux04 hethongtaptin
Linux04 hethongtaptin
 
To ghi nho ubuntu
To ghi nho   ubuntuTo ghi nho   ubuntu
To ghi nho ubuntu
 
Carte ref-ubuntu-vi (1)
Carte ref-ubuntu-vi (1)Carte ref-ubuntu-vi (1)
Carte ref-ubuntu-vi (1)
 
Làm thế nào để học linux trong 24h?
Làm thế nào để học linux trong 24h?Làm thế nào để học linux trong 24h?
Làm thế nào để học linux trong 24h?
 
Chuong ii
Chuong iiChuong ii
Chuong ii
 
Lưu trữ và xử lý dữ liệu trong điện toán đám mây
Lưu trữ và xử lý dữ liệu trong điện toán đám mâyLưu trữ và xử lý dữ liệu trong điện toán đám mây
Lưu trữ và xử lý dữ liệu trong điện toán đám mây
 
Linux Network Administration (LPI-1,LPI-2)
Linux Network Administration (LPI-1,LPI-2)Linux Network Administration (LPI-1,LPI-2)
Linux Network Administration (LPI-1,LPI-2)
 
Hệ điều hành (chương 4)
Hệ điều hành (chương 4)Hệ điều hành (chương 4)
Hệ điều hành (chương 4)
 
Giao Trinh MSDOS
Giao Trinh MSDOSGiao Trinh MSDOS
Giao Trinh MSDOS
 
File
FileFile
File
 
Bài 11
Bài 11Bài 11
Bài 11
 

Lesson 3 - Linux File System

  • 1. Trường Đại học Công nghệ Thông tin – ĐHQG TP.HCM Khoa Mạng máy tính và Truyền thông -----0-0----- Nhóm Open-Class Bài 2: Cấu trúc file trên Linux G.V: Nguyễn Hải Long LongNH@uitnetwork.com 1
  • 2. Nội dung bài học  Cấu trúc file trên linux  Ext3 file system  Loại tập tin và các dạng liên kết  Thao tác với hệ thống tập tin  Phân quyền cho hệ thống tập tin 2
  • 3. Cấu trúc file trên Linux 3
  • 4. Cấu trúc file trên Linux (tt)  /boot kernel và cấu hình boot  /bin các lệnh cơ bản  /dev khai báo thiết bị  /etc cấu hình hệ thống và các ứng dụng  /home thư mục lưu dữ liệu người dùng  /lib thư viện dùng chung  /mnt or /media thư mục mount CD, USB …  /proc thông tin process  /sbin các lệnh quản trị  /tmp dữ liệu tạm  /var dữ liệu biến động  /usr ứng dụng và thư viện 4
  • 5. Ext3 file system  Inode đại diện cho file bao gồm thuộc tính (Attributes) và con trỏ (Pointer) 5
  • 6. Ext3 file system  Lệnh fdisk xem, tạo, xóa partition.  Lệnh fsck chẩn đoán và sửa lỗi file systems.  Lệnh mount Ánh xạ một partion vào cây thư mục 6
  • 7. Các loại tập tin và dạng liên kết 7
  • 8. Các ký tự đặc biệt  Các câu lệnh trong linux phân biệt chữ in hoa và in thường   Ký tự chuyển hướng dòng lệnh  > và >> chuyển hướng đầu ra cho dòng lệnh  < chuyển hướng đầu vào cho dòng lệnh  ; thực hiện lệnh một cách tuần tự  && thực hiện lệnh sau khi lệnh trước thành công  | kết quả lệnh trước làm đầu vào cho lệnh sau 8
  • 9. Các lệnh với file  mkdir tạo thư mục  cp copy file (muốn copy cả thư mục thêm -r)  mv di chuyển, hoặc đổi tên thư mục  rm xoá bỏ các file trong thư mục (-r xoá tất cả)  rmdir xoá thư mục rỗng  ls xem thông tin các tập tin  find tìm kiếm tập tin theo mô tả  split chia nhỏ tập tin  cat tạo tập tin  ln tạo liên kết đến file (softlink hoặc hardlink) 9
  • 10. Các lệnh với file (tt)  cmp so sánh 2 tập tin nếu khác nhau thì đưa ra số dòng và byte khác nhau  diff so sánh 2 tập tin và in ra các dòng khác nhau  patch so sánh 2 tập tin và in file mới nhất 10
  • 11. Bảo mật hệ thống file  Các câu lệnh phân quyền và gán quyền  chown gán quyền sở hữu cho nhóm  chmod gán quyền cho file hoặc thư mục  unmask gán quyền cho thư mục và các file con 11
  • 12. Bài tập thực hành 1. Tạo thư mục /data và gán quyền 775 cho thư mục này 2. Copy tất cả các file trong thư mục ~ vào thư mục /data. So sánh quyền truy cập của các file trong thư mục ~ và /data 3. Tạo tập tin baitap3.txt trong thư mục /data. Kiểm tra quyền của file này. Hãy thiết lập sao cho các file và thư mục trong thư mục /data đều có quyền 755. 4. Mount file CentOS-5.5.iso vào thư mục /mnt/VirtualCD. Cắt nối file film 1.5GB khi có USB 1GB 5. Chép 25 tập film (mỗi tập khoảng 300MB) vào usb 1GB 12
  • 13. Q&A 13