初学Linux,还在摸索中,在这个过程中希望能记录下学习到的东西,参考的的书籍为<鸟哥的Linux私房菜> 在这里学到的主要命令有这几个: data cal bc man shutdown sync 1.基础命令操作 data----显示日期与实践的命令 cal----显示日历的命令 bc---- 简单好用的计算器命令 data 显示目前Linux的系统时间:data 显示年月日:data +%Y/%m/%d 显示时间:data +%H:%M cal 基本语法:cal [[month] yea…
写在前面:案例.常用.归类.解释说明.(By Jim)使用if-then语句如果命令的退出状态是0(成功执行命令),将执行then后面的所有命令.如果命令的退出状态是0以外的其他值,那么then后面的命令将不会执行,bash shell会移动到脚本的下一条命令. #!/bin/bash # testing the if statement if date then echo "it worked" fi (date返回0,执行then语句it worked) #!/bin/bash #…
用途说明 在执行Linux命令时,我们可以把输出重定向到文件中,比如 ls >a.txt,这时我们就不能看到输出了,如果我们既想把输出保存到文件中,又想在屏幕上看到输出内容,就可以使用tee命令了.tee命令读取标准输入,把这些内容同时输出到标准输出和(多个)文件中(read from standard input and write to standard output and files. Copy standard input to each FILE, and also to sta…
写在前面:案例.常用.归类.解释说明.(By Jim) for命令重复一系列的命令是一种常见的编程实践. #!/bin/bash # basic for command for test in A B C D E F G H I J K L M N O P Q do echo The next letter is $test done 结果:The next letter is AThe next letter is BThe next letter is CThe next letter is…
which whereis locate find alias file ls cat echotar bzip2 gzip history mv cp rm --------------------------------------------------------------------------------------------------------------------------------------------------linux下的查找命令which,whereis…