六:系统使用基础方法
1)系统登陆
图形登陆方式
文本登陆方式
gnome-session-quit --force ###注销用户 --force强制注销,不询问
2)工作界面转换
ctrl+alt+上|下
3)开始bash
1.Applications>Utilities>Terminal
2.鼠标右键----->open in terminal
3.gnome-terminal
4.ctrl+shift+n ##在新窗口中打开shell
ctrl+shift+t ##同一个窗口中打开新的tab
5.退出:exit | ctrl+d
七:系统关机,重启,锁屏
1)系统关机,重启
重启
reboot | init 6 |shutdown -r now
关机
poweroff | init 0 | shutdown -h now
2)锁屏
ctrl + alt +L ##在rhel7.0
win键 + L ##在rhel7.2
八:简单系统命令:
--1.date
watch -n 1 date ##date命令每秒执行一次,ctrl+c退出监控模式
date -d “STRING” ##显示STRING所描述的时间
date -s ##设置时间
20061010 ##只设置日期,时间为00:00:00
16:22:23 ##只设置时间,日期不做修改
16:22:23 20061010 ##日期时间都做修改
date -f filename ##显示文件的时间
date -r filename ##显示文件最后修改的时间
--2.cal
cal ##显示当前一个月的日历
cal 【month】 【year】 ##显示year中month的日历
cal -3 【month】【year】 ##显示month-1,month,month+1三个月的日历
--3.passwd
[root@foundation150 ~]# 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.
[kiosk@foundation150 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位
passwd 参数 用户名称
-S student ##用户密码信息
-l student ##锁定帐号
-u student ##解锁
-n 数字 student ##设定密码最短有效期
-x 数字 student ##设定密码最长有效期
-w 数字 student ##警告期
-i 数字 student ##设定用户非活跃天数
-d student ##清除用户密码
监控passwd密码信息
watch -n 1 passwd -S student
--4.file
file filename ##查看文件类型
--5.文件内容的查看
cat filename ##显示文件的全部内容
less filename ##分页浏览文件,按q退出
只有head/tail filename时,列出文件前/后10行的内容
head -n 数字 filename ##列出文件前n行的内容
tail -n 数字 filename ##列出文件后n行的内容
九: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 ##进入虚拟控制台