Linux cp 명령어 옵션중에 특정 파일/폴더를 제외하는 옵션이 없는 것 같다.

아래와 같이 ls 와 grep, cp를 piping 하면 특정 폴더를 제외하고 복사가 가능하다.

 

# ls | grep -v <file_to_exclude> | xargs -i cp {} <new_dir>

 

'Programming > Linux' 카테고리의 다른 글

Ubuntu 한글 입력  (0) 2022.12.31
PCI device rescan  (0) 2022.09.25
How to use GDB  (0) 2020.03.12
PhantomJS Installation on Ubuntu from source  (0) 2018.12.10
Linux screen  (0) 2018.09.27

+ Recent posts