jonnybolton16
jonnybolton16

Reputation: 232

Reset a builtin function

I have the following code in my .bashrc file:

function cd {
builtin cd "$@" && ls
}

which overwrites cd to always execute the ls command immediately after.

Short of removing it and rerunning the file, what can I do to reset the cd command?

Upvotes: 0

Views: 68

Answers (1)

chepner
chepner

Reputation: 531605

unset takes a -f flag to unset a function definition.

unset -f cd

Upvotes: 2

Related Questions