diff --git a/zshrc b/zshrc index d86d156..b4d1e0e 100644 --- a/zshrc +++ b/zshrc @@ -1383,6 +1383,17 @@ v() { fi } +# Try to give the real creation time of a file +xstat() { + for target in "${@}"; do + inode=$(ls -di "${target}" | cut -d ' ' -f 1) + fs=$(df "${target}" | tail -1 | awk '{print $1}') + crtime=$(sudo debugfs -R 'stat <'"${inode}"'>' "${fs}" 2>/dev/null | + grep -oP 'crtime.*--\s*\K.*') + printf "%s\t%s\n" "${crtime}" "${target}" + done +} + # PDF with fzf {{{ # pdf - fuzzy open with "${PDF_VIEWER}" from current directory # cd into the directory of the selected file