當前位置:
首頁 >
cp -r 和 cp -R 的区别
發布時間:2023/11/30
47
豆豆
默认站点
收集整理的這篇文章主要介紹了
cp -r 和 cp -R 的区别
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
今天倒騰linux根文件系統的時候發現 cp -r?/dev /dev_bak 時,竟然會 將磁盤設備中的數據進行一次拷貝,而不是僅僅建立設備文件。
于是到網上搜了一把,收獲不小。
http://www.loveunix.net/html/200407/33920.html
這里有人問同樣的問題,某人用英文作答:
-r Copies file hierarchies under the file or directory specified by the SourceFile or SourceDirectory parameter (recursive copy).?The -r flag processes special files in the same manner as regular files.?
-R Copies file hierarchies under the regular files and directories from the directory specified by the SourceFile or SourceDirectory parameter to the directory specified by the TargetDirectory parameter.?Special file types, such as first-in, first-out (FIFO) files and block and character device files, are re-created instead of copied.Symbolic links are followed unless the -h flag is specified. (The -R flag is preferred to the -r flag.) ? 這個回答已經是很明白了, ? ?cp -r 會把所有source當作普通文件(regular文件); ?而cp -R 對特殊文件(管道文件,塊設備文件,字符設備文件)會進行創建操作,而不是拷貝。 其實,以前我也看到過關于cp -r 和cp -R 的區別說明,只不過當時我沒有遇到具體的情景,所以沒有在意。
-R Copies file hierarchies under the regular files and directories from the directory specified by the SourceFile or SourceDirectory parameter to the directory specified by the TargetDirectory parameter.?Special file types, such as first-in, first-out (FIFO) files and block and character device files, are re-created instead of copied.Symbolic links are followed unless the -h flag is specified. (The -R flag is preferred to the -r flag.) ? 這個回答已經是很明白了, ? ?cp -r 會把所有source當作普通文件(regular文件); ?而cp -R 對特殊文件(管道文件,塊設備文件,字符設備文件)會進行創建操作,而不是拷貝。 其實,以前我也看到過關于cp -r 和cp -R 的區別說明,只不過當時我沒有遇到具體的情景,所以沒有在意。
總結
以上是默认站点為你收集整理的cp -r 和 cp -R 的区别的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关于cp命令中拷贝所有的写法
- 下一篇: Makefile选项CFLAGS,LDF