Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Openshift 我可以在oc exec命令中使用通配符吗?_Openshift_Aws Cli - Fatal编程技术网

Openshift 我可以在oc exec命令中使用通配符吗?

Openshift 我可以在oc exec命令中使用通配符吗?,openshift,aws-cli,Openshift,Aws Cli,我正在尝试在openshift Pod上运行远程命令,以删除某些目录中的一些文件,下面的命令起作用: oc exec mypod -i -t -- rm -f /tmp/mydir/1.txt 但是,我无法使用通配符(例如*.txt)删除所有.txt文件。带有通配符的命令不会给出任何错误,但不会删除任何文件 如有任何建议,将不胜感激 以下命令起作用: oc exec mypod -i -t -- find /tmp/mydir -type f -name '*.txt' -delete 希

我正在尝试在openshift Pod上运行远程命令,以删除某些目录中的一些文件,下面的命令起作用:

oc exec mypod -i  -t -- rm -f /tmp/mydir/1.txt
但是,我无法使用通配符(例如*.txt)删除所有.txt文件。带有通配符的命令不会给出任何错误,但不会删除任何文件


如有任何建议,将不胜感激

以下命令起作用:

oc exec mypod -i -t -- find /tmp/mydir -type f -name '*.txt' -delete

希望它对其他人有用

关键的一点是使用单引号引用命令中包含通配符的部分,否则通配符将根据本地框中当前目录中的内容展开。