Home  >  Q&A  >  body text

linux - Very psychedelic No such file or directory, please give me a scientific explanation

To upgrade OpenResty, rename the sbin/nginx file,

Then the psychedelic scene:

root@ubuntu-2gb-sgp1-01-1497159849981-2gb-sgp1-01:~/src/openresty-1.11.2.2# mv /usr/local/openresty/nginx/sbin/nginx{,`date +%m%d`}
-bash: mv /usr/local/openresty/nginx/sbin/nginx: No such file or directory

However, both /usr/local/openresty/nginx/sbin/ and nginx exist,

root@ubuntu-2gb-sgp1-01-1497159849981-2gb-sgp1-01:/usr/local/openresty/nginx/sbin# ls
nginx

If you rename it in the directory,

cd /usr/local/openresty/nginx/sbin
mv nginx{,`date +%m%d`}
ls
nginx0611

Please tell me scientists why~

By the way, OpenResty cannot simply copy the sbin/nginx file after make, otherwise luajit and other files will not be updated

某草草某草草2661 days ago890

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-06-12 09:26:27

    Finally it was found that it was a space problem, the code below is correct

    mv /usr/local/openresty/nginx/sbin/nginx{,`date +%m%d`}
    

    reply
    0
  • Cancelreply