📜  如何清除日志 snap.io - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:53.537000             🧑  作者: Mango

代码示例1
# make a file with name whatever.sh
# where contain botton script
# then run sudo bash whatever.sh

#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
    while read snapname revision; do
        snap remove "$snapname" --revision="$revision"
    done