dylanaraps / fff

📁 A simple file manager written in bash.
MIT License
4.09k stars 173 forks source link

sort downloads directory by time #182

Open Docbroke opened 3 years ago

Docbroke commented 3 years ago

example code

    ## sort by time in downloads dirs
    IFS=$'\n' 
    if [[ $PWD == ~/Downloads* ]]; then
        dirs=($(stat -c '%Y=%n' "${dirs[@]}" | sort -nr | cut -d '=' -f2))
        files=($(stat -c '%Y=%n' "${files[@]}" | sort -nr | cut -d '=' -f2))
    fi
    unset IFS

    list=("${dirs[@]}" "${files[@]}")

pull request https://github.com/dylanaraps/fff/pull/184