#!/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 05
- shell practice 06
- shell practice 07
- 03 shell基礎
- linux Shell 命令列-03-array Shell 陣列Linux命令列陣列
- Practice
- 2018-07-03 adb root/adb shell
- airflow practiceAI
- scientifically practice DP
- Practice| 流程控制
- hbase - [03] 客戶端常用命令(hbase shell)客戶端
- 03 shell程式設計之case語句與函式程式設計函式
- Vegetables need more practice.
- yolov5s ncnn practiceYOLOCNN
- [#181024][PAT Practice] A+B FormatORM
- Oracle 12.2 RAC on Linux Best Practice DocumentationOracleLinux
- 03_SHELL程式設計之條件判斷和流程控制程式設計
- SAP S4HANA LTMC Practice - the first shot!
- 1003 我要通過!| PAT (Basic Level) Practice
- Operating Systems: Principles and Practice 2nd ed. Edition
- The practice of high-performance graph computing system Plato in Nebula GraphORM
- PAT (Advanced Level) Practice 1149 Dangerous Goods Packaging (25分)Go
- Practice – iOS 專案持續整合實踐(一)iOS
- Practice - iOS 專案持續整合實踐(一)iOS
- Shell:子shell概念
- 03
- <OFFER03>03_01_DuplicationInArray
- PAT (Basic Level) Practice (中文)-1009-說反話 (20分)
- SDNU_ACM_ICPC_2021_Winter_Practice_4th [個人賽]ACM
- GoCN每日新聞(2018-03-03)Go
- shell——shell輸入輸出
- 打字大師3-盲打實踐:Master of Typing 3 - Practice for MacASTMac
- Software-Defined Networking and Security From Theory to Practice (Data-Enabled Engineering).pdf ...
- 12/03
- 03、RSTP
- 03、VLAN
- Shell程式設計-11-子Shell和Shell巢狀程式設計巢狀