티스토리 뷰

공부

[sh] cp all files (add hidden files)

승가비 2023. 1. 5. 02:18
728x90
cp -r asdf/* qwer/
cp -r asdf/.[^.]* qwer/ 2>/dev/null | true

https://superuser.com/questions/61611/how-to-copy-with-cp-to-include-hidden-files-and-hidden-directories-and-their-con/1761062#1761062

 

How to copy with cp to include hidden files and hidden directories and their contents?

How can I make cp -r copy absolutely all of the files and directories in a directory Requirements: Include hidden files and hidden directories. Be one single command with an flag to include the a...

superuser.com

https://stackoverflow.com/questions/25337405/how-to-make-cp-command-quiet-when-no-file-is-found-in-bash/75009023#75009023

 

How to make cp command quiet when no file is found in Bash?

I searched man cp, but can find no quiet option, so that cp does not report "No such file or directory". How can I make cp not print this error if it attempts, but fails, to copy the file?

stackoverflow.com

 

728x90
댓글