首页 > 系统服务 > 详细

linux 操作基础

时间:2015-12-22 16:03:28      阅读:303      评论:0      收藏:0      [点我收藏+]

内嵌指令 & 外部指令:

[root@MASTER ~]# type cd
cd 是 shell 内嵌
[root@MASTER ~]# type mkdir
mkdir 是 /usr/bin/mkdir
[root@MASTER ~]#

linux shell

[root@MASTER ~]# cat /etc/shells          //系统支持的shell
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh
[root@MASTER ~]# echo $SHELL           //系统默认shell
/bin/bash

[root@MASTER ~]# sh                    //进入sh shell
sh-4.2#
sh-4.2# exit
exit
[root@MASTER ~]# tcsh
[root@MASTER ~]# exit


[root@MASTER ~]# date +%Y/%m/%d_%H-%M-%S                       //按格式显示时间
2015/12/22_11-53-20

[root@MASTER ~]# file aaa.txt                                  //显示文件属性
aaa.txt: ASCII text

[root@MASTER ~]# head -3 /etc/passwd                           //显示开头3行
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin


[root@MASTER ~]# tail -3 /etc/passwd                            //显示末尾3行
ROOT-test
apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin

[root@MASTER ~]# wc -l /etc/passwd                            //查看文件 行
41 /etc/passwd
[root@MASTER ~]# wc -w /etc/passwd                            //查看文件 单词
69 /etc/passwd
[root@MASTER ~]# wc -c /etc/passwd                            //查看文件 字符
2013 /etc/passwd
[root@MASTER ~]# wc /etc/passwd                               //查看文件 行、word、字符
  41   69 2013 /etc/passwd
[root@MASTER ~]#



  568  date +%Y/%m/%d_%H-%M-%S
  569  history
[root@MASTER ~]# !568                                          //执行历史目录
date +%Y/%m/%d_%H-%M-%S
2015/12/22_12-00-57


[root@MASTER ~]#                                               //ctrl+r  查找历史命令
(reverse-i-search)`dig: dig @192.168.1.160 3gnet.1864710.mnc001.mcc460.gprs

技术分享

 

 

技术分享

linux 操作基础

原文:http://www.cnblogs.com/skyfly0772/p/5066667.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!