我有一个问题,我试图在项目中的所有文件中添加版权信息。由于它会影响许多目录和文件,我们的团队已经拆分了任务。所以我们每个人都将手动更新文件。我可以自动化它。
我试过:
find -exec sed -i "1i # x CONFIDENTIAL\n# _____________________\n#\n# 1997 - 2012 x Incorporated\n# All Rights Reserved.\n#\n# NOTICE: All information contained herein is, and remains\n# the property of x Incorporated and its suppliers,\n# if any. The intellectual and technical concepts contained\n# herein are proprietary to x Incorporated\n# and its suppliers and may be covered by U.S. and Foreign Patents,\n# patents in process, and are protected by trade secret or copyright law.\n# Dissemination of this information or reproduction of this material\n# is strictly forbidden unless prior written permission is obtained\n# from x Incorporated.\n" -- {} \;
它只是停止,只要它遇到 . 文件夹和当前目录下的任何文件夹。
我们可以通过指定文件的完整/部分名称来控制命令影响目录中的某些文件吗?