xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux bash which command and source command All In One

Linux bash which command and source command All In One

Linux bash which command & Linux bash source command

which

Python 3

$ which python
# python not found

$ which python3
/usr/bin/python3

VS Code

$ which code
/usr/local/bin/code

$ code .zshrc

# source
$ source ~/.zshrc

source

# source
$ source ~/.zshrc

demos

source for nvm

eric@rpi3b:~/Desktop $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16563  100 16563    0     0  17300      0 --:--:-- --:--:-- --:--:-- 17307
=> Downloading nvm from git to '/home/eric/.nvm'
=> Cloning into '/home/eric/.nvm'...
remote: Enumerating objects: 380, done.
remote: Counting objects: 100% (380/380), done.
remote: Compressing objects: 100% (323/323), done.
remote: Total 380 (delta 43), reused 179 (delta 29), pack-reused 0 (from 0)
Receiving objects: 100% (380/380), 382.75 KiB | 1.03 MiB/s, done.
Resolving deltas: 100% (43/43), done.
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/eric/.bashrc
=> Appending bash_completion source string to /home/eric/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
$ nvm --version
-bash: nvm: command not found
$ source /home/eric/.bashrc

$ nvm --version
0.40.1

image

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

https://www.cnblogs.com/xgqfrms/tag/which/

https://www.cnblogs.com/xgqfrms/tag/source/



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-08-30 17:09  xgqfrms  阅读(23)  评论(2)    收藏  举报