Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

sort downloads directory by time #182

Open
Docbroke opened this issue Aug 16, 2021 · 0 comments
Open

sort downloads directory by time #182

Docbroke opened this issue Aug 16, 2021 · 0 comments

Comments

@Docbroke
Copy link

Docbroke commented Aug 16, 2021

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 #184

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant