linux系統執行命令報錯:無法運行命令 權限不夠 解決辦法


最近在用linux系統的時候,有幾次碰到這種問題,在網上找到答案,特別轉載一下:

在用命令行執行一個后台監控的可執行文件時出現了如下提示:

[root@promote 桌面]# nohup /etc/nginx_check.sh
nohup: 忽略輸入並把輸出追加到"nohup.out"
nohup: 無法運行命令"/etc/nginx_check.sh": 權限不夠

或:

[root@promote 桌面]# nohup /etc/nginx_check.sh
nohup: ignoring input and appending output to `nohup.out'
nohup: failed to run command `/etc/nginx_check.sh': Permission denied


此問題說明在執行可執行文件nginx_check.sh時沒有權限,此時的解決方法是使用命令:chmod +x /etc/nginx_check.sh
次命令執行之后再執行 nohup /etc/nginx_check.sh & 此時執行結果如在下:
[root@ip-**-**-**-** tomcat6]# nohup: ignoring input and appending output to `nohup.out`

[1]+  Exit 2 nohup /etc/nginx_check.sh
[root@promote 桌面]# 
此時nginx_check.sh文件已被執行成功!

轉自:https://blog.csdn.net/moqiang02/article/details/37902407


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM