今天安裝Anaconda,下載好的Anaconda3-2018.12-Linux-x86_64.sh
,在執行./Anaconda3-2018.12-Linux-x86_64.sh時終端提示出現錯誤:
bash: ./Anaconda3-2018.12-Linux-x86_64.sh: Permission denied
原因:剛下載好的文件沒有執行權限
解決方法:
chmod u+x program_name.
然後盤它!
完整答案:
https://stackoverflow.com/questions/18960689/ubuntu-says-bash-program-permission-denied
另外 chmod u+x
與chmod +x
的區別:
chmod的手冊頁對此進行了介紹:
u stands for user.
g stands for group.
o stands for others.
a stands for all.
這意味着chmod u+x somefile只授予該文件執行權限的所有者,而chmod +x somefile與chmod a+x somefile相同。