This commit is contained in:
dingfeng.wong
2025-07-22 14:49:43 +08:00
parent 9fd495c976
commit 95f4735a94
+10
View File
@@ -11,6 +11,16 @@ better_env = r'''
export TERM=xterm
export PS1="\[\e[0;32m\]\u@\h (\$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src \([^ ]*\).*/\1/p;q}')):\w\$ \[\e[0m\]"
# Tail the last modified file in current directory
alias tl='_tl_func() {
LAST_MODIFIED_FILE=$(find . -maxdepth 1 -type f -printf "%T@ %p\0" | sort -znr | head -zn1 | cut -d" " -f2- --zero-terminated);
if [ -n "$LAST_MODIFIED_FILE" ]; then
echo "Tailing: \"$LAST_MODIFIED_FILE\"";
tail "$@" "$LAST_MODIFIED_FILE";
else
echo "No files found in the current directory to tail.";
fi
}; _tl_func'
echo "Bash customizations sourced successfully!"
'''