rm -rf ~/.jenkins/jobs/getfromgit/workspace/gitcheckoutdir
删除目录
下的所有内容~/.jenkins/jobs/getfromgit/workspace/gitcheckoutdir
如何删除目录下的所有内容:
~/.jenkins/jobs/getfromgit/workspace/
目录除外:
~/.jenkins/jobs/getfromgit/workspace/gitcheckoutdir
答案 0 :(得分:2)
最好的方法是首先移动gitcheckoutdir(1),删除工作区的内容(2),然后移回gitcheckoutdir(3);它会给:
(1)
$ mv ~/.jenkins/jobs/getfromgit/workspace/gitcheckoutdir ~/.jenkins/
(2)
$ rm -rf ~/.jenkins/jobs/getfromgit/workspace/*
(3)
$ mv ~/.jenkins/gitcheckoutdir ~/.jenkins/jobs/getfromgit/workspace/