Hot answers tagged


You'd have to actually change directories in your script. Typically: cd "$(dirname "$0")"


Is there a way to source my .bashrc when I exit an ssh session? Yes, define a shell function: ssh() { command ssh "$@"; source ~/.bashrc; }


If you want this to be command-specific, then redefining ssh (as mentioned in another answer) is probably the best approach. If you actually prefer something more general, bash has a PROMPT_COMMAND shell variable you can set to run a command (or multiple commands) before the shell prompt is printed, which would happen right after ssh (or any other command) ...


fish_greeting can be a function function fish_greeting; date --rfc-2822 | cowsay -f tux | lolcat; end


Try the command du(disk usage).

Only top voted, non community-wiki answers of a minimum length are eligible