what does command test -x do in ubuntu?

2020-05-09 17:50发布

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

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

Does it test if already executing file /usr/sbin/logrotate?

2条回答
够拽才男人
2楼-- · 2020-05-09 17:52

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

'-x file'
     True if file is executable.
查看更多
爷的心禁止访问
3楼-- · 2020-05-09 18:02
test -x /path/to/file

It checks if file exists and is executable by current user

查看更多
登录 后发表回答