Copying Files

Sometimes, instead of moving a file, you'll want to make a copy, and move that copy somewhere else. The cp command is useful for this. cp test.txt test2.txt will copy the test.txt file, and create a new file called test2.txt with the contents of test.txt.

Instructions

  • Copy the file at /home/dq/test/test.txt to/home/dq/test/test2.txt.

 

cp test/test.txt test/test2.txt

转载于:https://my.oschina.net/Bettyty/blog/746439

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
解释一下“def main(): newBricks = packageVersionsFromConfig() newDict = getDependencies(newBricks, "davinci") sipver = newDict.get(SIP_PACKAGE_NAME) sipver =sipver['release'] logging.info("BRICKS SIP package version is %s", sipver) handleRepo(SIP_PACKAGE_NAME, False) logging.info("Cloning SIP repo, hold your horses, this could take a while (1.8G)") repo = git.Repo(os.path.join(GIT_WORKING_DIR, SIP_PACKAGE_NAME)) repo.git.checkout(sipver) logging.info ("Git status of repo %s is %s ", SIP_PACKAGE_NAME, repo.git.status()) #copying files to SIP folder sipVersion = [] reg_compile = re.compile("SIP_*") for dirpath, dirnames, filenames in os.walk(os.path.join(GIT_WORKING_DIR, SIP_PACKAGE_NAME, "src")): sipVersion = sipVersion + [dirname for dirname in dirnames if reg_compile.match(dirname)] logging.info("Vector SIP version is %s", sipVersion) if input("WARNING !!!! You're about to overwrite your local SIP folder. Are you sure you want to continue ? (y/n)") != "y": exit("I wish you good fortune") for dirpath, dirnames, filenames in os.walk(os.path.join("src","SIP")): for filename in filenames: if filename == "CMakeLists.txt": continue absfile = os.path.join(dirpath, filename) #logging.info(absfile) os.remove(absfile) for dirname in dirnames: if dirname == "Components": continue absdir = os.path.join(dirpath, dirname) #logging.info(absfile) shutil.rmtree(absdir) logging.info("Copying source files from Vector SIP cloned repo to the SIP folder") distutils.dir_util.copy_tree(os.path.join(GIT_WORKING_DIR, SIP_PACKAGE_NAME, "src", sipVersion[0]), os.path.join("src","SIP")) ”
07-11

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值