#!/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
- 03 shell基礎
- Practice
- linux Shell 命令列-03-array Shell 陣列Linux命令列陣列
- airflow practiceAI
- scientifically practice DP
- Practice| 流程控制
- Best Practice in Writing
- hbase - [03] 客戶端常用命令(hbase shell)客戶端
- 03 shell程式設計之case語句與函式程式設計函式
- “Docker Practice”讀書筆記Docker筆記
- yolov5s ncnn practiceYOLOCNN
- 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
- 03
- HDOJ 1094 A+B for Input-Output Practice (VI)
- Operating Systems: Principles and Practice 2nd ed. Edition
- 03、RSTP
- 03、VLAN
- 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索引
- 衝刺03
- 03約束