天天看點

菜鳥學Linux 第005篇筆記 根檔案系統

一、檔案系統

rootfs: 根檔案系統

FHS:Filesystem Hierarchy Standard 檔案系統層級标準

/

/boot 系統啟動相關檔案,如核心、initramfs、以及grub(bootloader)

/dev device 裝置檔案:

block塊裝置 随機裝置,資料塊

character字元裝置 線性裝置,有次序的

裝置号:主裝置号(major)和次裝置号(minor)

/etc Editable Text Configuration 配置檔案

/home 使用者家目錄,每一個使用者的家目錄通常預設為/home/USERNAME

/root 根使用者家目錄 root使用者權限非常大(生産環境下不建議使用root登入)僅當使用時再登入

/lib library庫檔案和核心子產品檔案

/lib/modules 核心子產品檔案

靜态庫 .a

動态庫 .dll .so(shared object)

/media 挂載點目錄,用來挂載移動裝置

/mnt 挂載點目錄,用來挂載額外的臨時檔案系統

/misc 雜項

/opt optinal 可選目錄,第三程式的安裝目錄(現不存放在這裡)

/proc 僞檔案系統,核心映射檔案(其實裡邊沒有檔案) 系統調優用到這個目錄

/sys 僞檔案系統,跟硬體裝置相關的屬性映射檔案,管理硬體

/tmp temporary臨時檔案系統

/var variable可變化的檔案目錄

/bin binary可執行檔案目錄(使用者指令)

/sbin binary可執行檔案目錄(管理指令)

/usr universal,shared,read-only 全局,可共享的,隻讀

/bin

/sbin

/lib

/usr/local:

二、Linux命名規則

1.長度不能超過255個字元

2.不能使用/當作檔案名

3.其它任何字元都可以,嚴格區分大小寫

4.檔案名不可和檔案同名(windows linux 都不可以)

三、檔案管理

touch change file timestamps

-c do not create any files

-a change only the access time

-m change only the modification time

-t use [[CC]YY]MMDDhhmm[.ss] instead of current time

stat display file or file system status

rm remove files or directories

-i prompt before any removal

-f ignore nonexistent files, never prompt

-r remove directories and their contents recursively

rm -rf / 切記不要使用此條指令,會删除所有檔案 

建立檔案 可以使用檔案編輯器來建立

nano Nano’s ANOther editor, an enhanced free Pico clone

英文字元ASCII(American Standard Code for Information Interchange)

存儲128不同的字元,計算機存儲最小機關位元組

2^7=0,127 000 0000 -  111 1111

漢字(國标GB18030 GBK GB2312 Unicode全字元集)

2^16

兩個位元組一個漢字

0000 0000 0000 0000 

四、目錄管理

ls

cd

pwd

mkdir make a empty directory

e.g mkdir -pv /mnt/test/{x/m,y} 花括号展開

mkdir -pv /mnt/text2/{a,d}_{b,c}

同時建立目錄a_b a_c d_b d_c

-p  no error if existing, make parent directories as needed

-v print a message for each created directory

rmdir remove empty directories

-p 隻可删除一脈單傳

e.g rmdir -p a/b/c/d/

tree 檢視目錄樹

運作程式

裝置管理

軟體管理

程序管理

網絡管理

本文轉自Winthcloud部落格51CTO部落格,原文連結http://blog.51cto.com/winthcloud/1853947如需轉載請自行聯系原作者

Winthcloud

繼續閱讀