what does command test -x do in ubuntu?

后端 未结 2 1853
天命终不由人
天命终不由人 2021-01-29 10:20

what does test -x from /etc/cron.daily/logrotate do?

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
<
相关标签:
2条回答
  • 2021-01-29 10:39

    Type man test in Google and it will find you a manual page that says this:

    '-x file'
         True if file is executable.
    
    0 讨论(0)
  • 2021-01-29 10:50
    test -x /path/to/file
    

    It checks if file exists and is executable by current user

    0 讨论(0)
提交回复
热议问题