Skip to content

Instantly share code, notes, and snippets.

@jetsonhacks
Last active March 5, 2025 07:20
Show Gist options
  • Save jetsonhacks/9faeafaa0d287d5e3580c29898931798 to your computer and use it in GitHub Desktop.
Save jetsonhacks/9faeafaa0d287d5e3580c29898931798 to your computer and use it in GitHub Desktop.
Terminal for Videos
# Use this in a Terminal to remove the name of the SSD you're using; shortens prompt
shorten_path() {
local full_path="$PWD"
if [[ "$full_path" =~ ^/media/"$USER"/[^/]* ]]; then
local prefix="${BASH_REMATCH[0]}"
echo "~${full_path#$prefix}"
else
echo "$full_path"
fi
}
export PS1='\[\e[32m\]\u@\h\[\e[0m\]:\[\e[34m\]$(shorten_path)\[\e[0m\]\$ '​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment