linux一些基本命令
2016-07-28 10:06:48 0 举报
AI智能生成
命令
作者其他创作
大纲/内容
目录
~根目录
home家目录
pwd
显示当前工作目录
cd
不加任何切回主目录
<p class="MsoNormal"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Cd ~USERNAME:<font face="宋体">切换至指定用户家目录</font></span></p>
<p class="MsoNormal" style="text-indent: 21pt;"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Cd -<font face="宋体">:从当前目录切换回上一次所在目录</font></span><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"><o:p></o:p></span></p><p class="MsoNormal" style="text-indent: 21pt;"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"> </span><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">=cd $OLPWD:<font face="宋体">上一次的工作目录</font></span><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"><o:p></o:p></span></p>
ls
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 16pt; background: rgb(255, 255, 0);"> </span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);">Ls -a:显示所有文件,包括隐藏文件</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);">Ls -A显示除.和..外的所有文件</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> Ls -d +不定目录 显示目录</span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> Ls -a /var/log</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> Ls -l:显示文件的详细属性信息</span></b><b style="font-size: 13px;"><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);">例如:- r w - r- -r- -. 1 root root 8957 10 月 14 19:34 boot.log</span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> 最左边的-表示文件类型,共有-,d.b.c.l.s.p几种</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> </span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 14pt; background: rgb(255, 255, 0);">c是字符逻辑,b是模块,</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> rw-表示文件属主的权限;</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> r--其他用户(非属主、属组)的权限</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> 1:表示文件被硬链接的次数</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> root:文件的属主</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> Root :文件的属组:</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> 8957表示文件的大小,单位字节</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> 8957 10 月 14 19:34:文件最后一次被修改的时间</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p><p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"> 最后是文件名</span></b><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 10.5pt; background: rgb(255, 255, 0);"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">-h=-- human-readable :对文件的大小单位换算(人类易读的数值);换算后结果可能不精确</span><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Ls-d:--directory看目录自身属性而非其内部的文件列表 </span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Ls-r:反向显示内容</span></b><b><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Ls-R:recersive递归显示</span></b><b><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">concatenate(<font face="宋体">连接</font><font face="Calibri">)</font><font face="宋体">是显示</font></span><b><span style="font-family: 宋体; color: rgb(255, 0, 0); font-size: 16pt;">文本文件内所有</span></b><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">内容,是文本文件查看工具<font face="Calibri">=info</font></span></p>
cat
<p class="MsoNormal" style="text-indent: 21pt;"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Cat -n/etc/fstab <font face="宋体">给内容编号</font></span><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;"><o:p></o:p></span></p>
Cat能进行输入输出重定向
<p class="MsoNormal"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">Cat-E<font face="宋体">显示行尾部的</font><font face="Calibri">$</font><font face="宋体">符号</font></span></p>
file
<p class="MsoNormal"><span style="font-family: 宋体; color: rgb(0, 0, 0); font-size: 10.5pt;">查看文件类型<font face="Calibri">=deter file type</font><font face="宋体">详细内容</font></span></p>
echo
<p class="MsoNormal"><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);">双引号只识别变量,不识别命令</span><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);">单引号最傻</span></p>
<p class="MsoNormal"><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);">反向单引号最聪明<font face="Calibri">=$</font><font face="宋体">()</font></span><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:28.0000pt;"><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);">-e<font face="宋体">让转义符生效</font></span><span style="mso-spacerun:'yes';font-family:宋体;mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;mso-bidi-font-family:'Times New Roman';font-size:14.0000pt;mso-font-kerning:1.0000pt;background:rgb(255,0,255);mso-highlight:rgb(255,0,255);"><o:p></o:p></span></p>
mount
df
0 条评论
下一页