Todos Nuevo

user:thomas gists creados por el usuario

title:mygist gists con el título indicado

filename:myfile.txt gists que contienen archivos con el nombre indicado

extension:yml gists que contienen archivos con la extensión indicada

language:go gists que contienen archivos con el lenguaje indicado

topic:homelab gists with given topic

Iniciar sesión


Todos Nuevo Iniciar sesión

All gists matching topic USB

Recientemente creado
Menos reciente creado
Recientemente actualizado
Menos reciente actualizado

timmy / 卸載與彈出外接 USB 裝置腳本

0 gustos
0 bifurcaciones
1 archivos
Última actividad 9 months ago
此腳本可自動尋找、卸載並彈出所有外接 USB 裝置,確保安全移除磁碟並避免資料損毀。
ShellScript USB diskutil eject unmount
1 #!/bin/bash
2 # Script to unmount and eject all external USB drives
3
4 # 找到所有外接裝置並處理
5 diskutil list | grep "external, physical" | awk '{print $1}' | while read -r disk; do
6 echo "Unmounting all volumes on $disk..."
7 diskutil unmountDisk "$disk"
8 echo "Ejecting $disk..."
9 diskutil eject "$disk"
10 done
Siguiente Anterior

Desarrollado por Opengist ⋅ Load: 12ms⋅

Español
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文