基础篇--使用终端
使用终端(可以右键点击打开,也可以ctrl+alt+t打开)
date命令:
[root@localhost ~]# date Fri May 29 06:58:24 EDT 2015 [root@localhost ~]# date +%R 06:58 [root@localhost ~]# date +%x 05/29/2015
passwd命令:
[root@localhost ~]# passwd Changing password for user root. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully.
file命令:查看文件类型
[root@localhost ~]# file command.txt command.txt: ASCII text [root@localhost ~]# file rhel.iso rhel.iso: # ISO 9660 CD-ROM filesystem data 'RHEL-7.0 Server.x86_64 ' (bootable)
head命令:查看文件的头默认10行(使用-n num)
[root@localhost ~]# head /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin
wc命令:统计行数与大小
[root@localhost ~]# wc command.txt 6 5 28 command.txt [root@localhost ~]# wc -w command.txt 5 command.txt [root@localhost ~]# wc -l command.txt 6 command.txt [root@localhost ~]# wc -c command.txt 28 command.txt
在新版本中,rhel的自动补齐很强大,即使很多参数也可以自动补齐!
script命令:启动一个后台记录脚本!