钓鱼网站在线生成,装修网站系统,上海网站制作培训,soho做网站多少钱今天倒腾linux根文件系统的时候发现 cp -r /dev /dev_bak 时#xff0c;竟然会 将磁盘设备中的数据进行一次拷贝#xff0c;而不是仅仅建立设备文件。于是到网上搜了一把#xff0c;收获不小。http://www.loveunix.net/html/200407/33920.html这里有人问同样的问题#xff…今天倒腾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 的区别说明只不过当时我没有遇到具体的情景所以没有在意。