#!/bin/bash
# author: Chiweiming
# version: v1
# date: 2024-03-26
<<COMMAND
寫一個檢測指令碼,用來檢測本機所有磁碟分割槽讀寫是否正常。
做法:遍歷每一個掛載點,在每一個掛載點新建一個檔案,然後再刪除該檔案,如果一切正常則說明該分割槽沒問題
COMMAND
for path in $(df | grep -v "tmpfs" | sed '1d' | awk '{print $NF}')
do
touch ${path}/test.txt && rm -f ${path}/test.txt
if (( $? == 0 )); then
echo "${path} is nice"
else
echo "${path} is error"
fi
done
shell practice 03
相關文章
- shell practice 04
- shell practice 06
- shell practice 05
- shell practice 07
- Practice
- linux Shell 命令列-03-array Shell 陣列Linux命令列陣列
- Practice| 流程控制
- Best Practice in Writing
- hbase - [03] 客戶端常用命令(hbase shell)客戶端
- 03 shell程式設計之case語句與函式程式設計函式
- “Docker Practice”讀書筆記Docker筆記
- Spring Boot In Practice (0):基礎Spring Boot
- css best practice for big team and projectCSSProject
- 03_SHELL程式設計之條件判斷和流程控制程式設計
- Oracle 12.2 RAC on Linux Best Practice DocumentationOracleLinux
- A+B for Input-Output Practice (IV) (sdut oj)
- Practice5.1 測試與封裝5.1封裝
- Practice - iOS 專案持續整合實踐(一)iOS
- Practice – iOS 專案持續整合實踐(一)iOS
- Spring Boot In Practice (1):Redis快取實戰Spring BootRedis快取
- webpack-best-practice-最佳實踐-部署生產Web
- HDOJ 1094 A+B for Input-Output Practice (VI)
- Oracle GoldenGate Best Practice - sample parameter files (文件 ID 1321696.1)OracleGo
- 03《構建之法》閱讀筆記03筆記
- SDNU_ACM_ICPC_2021_Winter_Practice_4th [個人賽]ACM
- 1.2 基礎知識——關於豬皮(GP,Generic Practice)
- 03 - Dive into CSSCSS
- Oracle——03索引Oracle索引
- GoCN每日新聞(2018-03-03)Go
- 打字大師3-盲打實踐:Master of Typing 3 - Practice for MacASTMac
- Oracle GoldenGate Best Practice - Testing Maximum Performance of Disks in UNIX [ID 1356855.1]OracleGoORM
- 03.Django-ORMDjangoORM
- day03 字串字串
- MyBatis-03(CRUD)MyBatis
- AndroidBanner - ViewPager 03AndroidViewpager
- 大資料_03大資料
- 24_03_07
- Flask03 路由Flask路由