Are there other useful cp options?

079

Yes, there are several other useful options for the cp command. Here are some of them:

  • -r or --recursive: Copy directories recursively. This is necessary when you want to copy a directory and its contents.

  • -u or --update: Copy only when the source file is newer than the destination file or when the destination file is missing.

  • -v or --verbose: Provide detailed output of the copy process, showing which files are being copied.

  • -a or --archive: Copy files and directories recursively while preserving attributes such as timestamps, symbolic links, and permissions.

  • -p: Preserve the file attributes (mode, ownership, timestamps) when copying.

  • -f or --force: If the destination file exists, it will be overwritten without prompting.

These options can enhance the functionality of the cp command and make file management more efficient.

0 Comments

no data
Be the first to share your comment!