WindowsBatch与LinuxShell比较[命令比较]

您所在的位置:网站首页 linux和shell命令的区别 WindowsBatch与LinuxShell比较[命令比较]

WindowsBatch与LinuxShell比较[命令比较]

#WindowsBatch与LinuxShell比较[命令比较]| 来源: 网络整理| 查看: 265

阅读更多

Windows 批处理与Linux Shell比较[命令比较]

一 Windows Dos与Linux 相同的内部命令二 Windows Dos与Linux 不同的内部命令三 Windows Dos与Linux 不同的内部命令2四 Windows Dos与Linux 不同的外部命令五 命令帮助五 更多参考六 Linux命令在Windows上执行几乎所有的Linux的命令都同时被编译为Windows的exe版本,所以我们可以在Windows上使用所有的Linux的命令。更多参考:1)http://unxutils.sourceforge.net2)http://www.cnblogs.com/itech/archive/2009/05/22/1487120.html

七 有用但是不常用的命令1)robocopy用来copy

复制代码 Windows的copy命令:copy “c:\new folder\1.txt” c:copy “c:\new folder\1.txt” c:\2.txtLinux的cp和Windows的cp命令:cp ~/a.txt ~/test (cp c:\1.txt c:\test2)cp ~/a.txt ~/test/b.txt (cp c:\1.txt c:\3.txt)在Windows上推荐robocopy,功能强大,更多的返回值,例如:robocopy /E /NP /R:12 SourceDir DestinationDir *.txt *.doc /XF test.txt /xd test [从SourceDir拷贝所有的txt和doc文件到DestinationDir,其中排除test.txt和子文件夹下test] 复制代码 2)printf用来格式为字符串 Printf %3d 2 [格式为__2]printf %-3d 2 [格式为2__]Printf %03d 2 [格式为002]Printf %1.2f 3.1415926 [格式为3.14]printf %8s "aaaa" [格式为____aaaa]printf "\nXXX: %03d\n" 3 [格式为__3] 所有的printf的格式参数: 复制代码 SpecifierDescription%cASCII character (prints first character of corresponding argument)%dDecimal integer%iSame as %d%eFloating-point format ([-]d.precisione[+-]dd) (see following text for meaning of precision)%EFloating-point format ([-]d.precisionE[+-]dd)%fFloating-point format ([-]ddd.precision)%g%e or %f conversion, whichever is shorter, with trailing zeros removed%G%E or %f conversion, whichever is shortest, with trailing zeros removed%oUnsigned octal value%sString%uUnsigned decimal value%xUnsigned hexadecimal number; uses a-f for 10 to 15%XUnsigned hexadecimal number; uses A-F for 10 to 15%%Literal % 复制代码 3)Expr用来表达式计算 复制代码 expr 5 + 7 expr 5 – 6expr 5 ”*” 4 expr 5 / 7expr 7 % 9 expr 1 “|” 0 expr 1 “&” 0 expr 3 “>” 6 expr 3 “=” 3 expr 3 “


【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3