简体   繁体   中英

How to revert a shell command? Overwritten the "pwd" command

After typing "pwd" in shell you normally get the path to the current working directory. However, if you type "pwd()" instead, you get a message [function>] after which you can type anything (eg: echo hi; ls -laR).

Now executing the "pwd" command will no longer print the current working directory, but instead it will execute the user input every time.

My question is, how do I revert this behaviour? Thanks!

Have you tried to restart Bash? If that doesn't work you can use unset -f pwd remove the function.

More info athttp://mywiki.wooledge.org/BashGuide/CompoundCommands#Functions

by doing pwd(), you are creating a shell function.

Get rid of it by:

unset pwd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM