find . -type f \( -name "*.cpp" -o -name "*.h" \) | xargs sed -i '1s;^;/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n * All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n;'
and
find . -type f -name "*.py" | xargs sed -i '1s;^;"""\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n"""\n\n;'
tl;dr:
and