1.date
usage: date [OPTION]….[+FORMAT]
or: date[-u|–utc|–universal] [MMDDhhmm[[CC]YY][.ss]]
[月天时分[[世纪]年][秒]]
date
## 查看当前时间
watch -n 1 date
##让date命令每秒执行一次,ctrl +c 推出监控模式
date 11181115
###把系统时间设定为11月18日11:15 格式:月月天天小时分钟
截图
date 111811152016.55
##2016表示年(可以不加).55 表示秒(可以不加)
截图
date -d +xday|-xday ##查看x天后或者前的时间
截图
+%…. ##设定date的输出格式
其中%Y表示年
%m 月
%d 天
%k 时(1-24)
%l 时(1-12)
%M 分
%S 秒
截图
2.passwd
1.passwd 修改用户密码
[root@localhost Desktop]# 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.
[root@localhost Desktop]$ passwd
键入命令后显示:
Changing password for user kiosk. ##改变普通用户密码
Changing password for kiosk.
(current) UNIX password: ##输入当前密码
New password:
BAD PASSWORD: The password is the same as the old one ##和原始密码不能相似
New password:
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic ##密码必须是无序数字+字母
New password:
BAD PASSWORD: The password is shorter than 8 characters ##密码必须>8位
2.passwd [参数] 用户名称
监控passwd密码信息
watch -n 1 passwd -S student
下面的截图都是在执行操作后watch的监控信息
-S student ##用户密码信息
–status student
-l student ##锁定帐号
-u student ##解锁
passwd -u student
-n 1student##设定密码最短有效期
-x 30student##设定密码最长有效期
-w 3student##警告期
-i 2student##设定用户非活跃天数
恢复之前设置
passwd -n 0 -x 99999 -w 7 -i -1
student
-d student ##清除用户密码
3.file
file 文件名字 ##查看文件类型
4.文件的查看
cat filename ##显示文件的全部内容
less file ##分页浏览,按“q”退出
head filename ##显示一个文件的前几行
head -n 5 filename ##前五行
tail filename ##显示文件后几行
tail -n 5 filename ##显示一个文件的后5行
cat查看文件中的内容
head命令查看/etc/passwd文档的前10行内容
head -n 5 查看前5行内容,tail用法和head类似
5.wc统计文件容量信息
wc -l ##行数
-w ##字数
-c ##字节数
-m ##字符数
6.Tab键
在系统中table键可以自动补齐存在的命令,文件名称和某些命令的参数
a+Tab+Tab 显示系统中所有a开有的命令
7.history历史调用
history ##显示历史
hostory -c ##清除当前环境当中的历史命令
!数字 ##执行第多少行命令
!字母 ##执行最近一条以这个字母开头的命令
ctrl +R/r +关键字 ##执行最近一条含有这个关键字的命令
上下键 ##逐行调用命令
8.linux中的快捷键
左右 ##一个字符一个字符移动
ctrl +左右 ##一个字一个字移动
ctrl + a ##光标移动到行首
+ e ##光标移动到行尾
+ u ##光标所在位置删除到行首
+ k ##光标所在位置删除到行尾
+ r+关键字 ##调出最近一条含有关键字的命令
+ c ##撤销以输入的命令
+ d ##关闭当前环境
+ L ##清空屏幕
+ shift + c ##复制
+ shift + v ##粘贴
+ shift + t ##在现有shell中重新打开一个table
+ shift + n ##在shell中打开一个新的shell
+ shift + pageup|pagedown ##切换table
+ alt + l ## 锁屏
+ alt +上|下 ##切换工作界面
+ alt + f1|f7 ##进入图形界面
+ alt + f2-f6 ##进入虚拟控制台