建立目錄和檔案(linux)

2021-10-07 14:49:56 字數 1271 閱讀 7569

使用mkdir命令建立目錄結構/notes/cloud/

使用touch命令在/notes/cloud/目錄下建立空檔案readme、day01.txt、day02.txt、hcip.mp4

列出 /notes/cloud/ 目錄下所有以 .txt 結尾的檔案

3.2 步驟

實現此案例需要按照如下步驟進行。

步驟一:建立目錄結構

1)建立新目錄

[root@svr7 ~]

# ls -ld /notes/cloudls:

無法訪問/notes/cloud

: 沒有那個檔案或目錄

[root@svr7 ~]

# mkdir /notes/cloud

mkdir

:無法建立目錄"/notes/cloud"

: 沒有那個檔案或目錄

[root@svr7 ~]

# mkdir -p /notes/cloud

2)確認建立結果

[root@svr7 ~]

# ls -ld /notes/cloud/

drwxr-xr-x. 2 root root 6 12月 19 11:44 /notes/cloud/

步驟二:建立空檔案

1)進入目標資料夾

[root@svr7 ~]

# cd /notes/cloud/

[root@svr7 cloud]

# pwd

/notes/cloud

2)建立新檔案

[root@svr7 cloud]

# ls

[root@svr7 cloud]

# touch readme day01.txt day02.txt hcip.mp4

3)確認建立結果

[root@svr7 cloud]

# ls

day01.txt day02.txt hcip.mp4 readme

步驟三:列出 /notes/cloud/ 目錄下所有以 .txt 結尾的檔案

使用萬用字元 * 表示檔名中的未知部分。

[root@svr7 ~]

# ls /notes/cloud/*.txt

/notes/cloud/day01.txt /notes/cloud/day02.txt

建立目錄和檔案

1 在 opt下遞迴建立a b c 2 在 opt a b c建立乙個空檔案tarena.txt 3 為檔案 etc sysconfig network scripts ifcfg eth0 建乙個快捷方式存放到 etc ifcfg eth0 4 同時建立 nsd root zhangsan 當前路...

linux 識別目錄和檔案

1 linux 作業系統的組成一般分為3個部分 核心 kernel 命令解釋層,檔案結構 file structure 藍色檔案 目錄 白色檔案 一般性檔案,如文字檔案,配置檔案,原始碼檔案等 淺藍色檔案 鏈結檔案,主要是使用ln命令建立的檔案 綠色檔案 可執行檔案,可執行的程式 紅色檔案 壓縮檔案...

linux目錄和檔案限制

目錄限制 ext3預設配置 include linux ext3 fs.h define ext3 link max 32000 個 ext 4 無限 檔案限制 檔案限制取決於系統的inode數,inode用完了也就能建立新檔案了 inode用於索引記錄block 塊 資訊 block是連續多個se...