计算机
计算机
alias rm=trash
trash()
{ 
    files=()
    timestamp=$(date +%s)
    for file in "$@"
    do
        if [[ ${file:0:1} != "-" ]] 
        then
            files=("${files[@]}" "${file}")
        fi
    done

    mkdir -p ~/.trash/$timestamp
    echo `date -r $timestamp '+%x %X'` " $timestamp: rm $* --> mv "${files[@]}" --> source: `pwd`" >> ~/.trash/.trash.log 
    mv "${files[@]}" ~/.trash/$timestamp
}
最后修改日期:2019年8月1日

作者