默认情况下,linux有一个图形界面,五个文本虚拟终端
root@instructor# tty  用来查看当前是在哪个tty下
ctrl+alt+F1-F7用来切换不同终端
startx命令用来启动图形化界面
一、图形界面
从图形界面切换到文字界面需要ctrl+alt+F1-F7
从文字界面切换到其他文字界面仅需alt+F1-F7
ctrl+shift+t创建多个命令终端
shift+Pgup/Pgdn在有很多输出的时候翻页查看
ctrl+shift+c复制选中文字
ctrl+shift+v粘贴
ctrl+Pgup/Pgdn在不同的文字接口间转换

二、安装鼠标
yum install gpm
安装好后使用yum info gpm查看安装信息
然后使用service gpm restart重启服务后就可以用鼠标了
注:光标选中文字,按鼠标中键可以复制并粘贴。

三、修改密码
1.图形界面
system-preferences-about me
change password
2.命令行CLI:password
passwd用来改自己的密码
passwd user 超级用户用来修改其他人的密码
超级用户可以随意修改其他用户的密码,且不受密码强度限制
普通用户只能修改自己的密码,受密码强度限制
超级用户转换成其他用户无需输入密码 su - username
普通用户转换成超级用户需要输入密码 su -

四、关于超级用户
超级用户是在系统中uid=0的用户
#id    可以查看当前用户的ID
ctrl + d 可以快速退出当前用户

五、sudo命令
超级用户为了方便管理,讲某些只有超级用户能执行的权利下放给其他
普通用户。例如,这里讲超级用户的所有权利下放给eric用户
[root@instructor ~]# visudo  进入编辑器
找到第98行,照着root写一条
## Allow root to run any commands anywhere
    98 root    ALL=(ALL)       ALL
    99 eric ALL=(ALL)     ALL
存盘退出

[root@instructor ~]# su - eric
[pengyuzhe@instructor ~]$ ls /root   eric查看root用户的家目录
ls: cannot open directory /root: Permission denied   权限被拒绝
[eric@instructor ~]$ sudo ls /root     使用sudo命令来查看

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

   #1) Respect the privacy of others.
   #2) Think before you type.
   #3) With great power comes great responsibility.

[sudo] password for eric:       提示输入eric用户的密码,而非root的
anaconda-ks.cfg  Documents  etc          etc.tar.gz  Pictures      post-install.log  Templates
Desktop          Downloads  etc.tar.bz2  Music       post-install  Public            Videos
再次使用sudo执行相同命令时,无需密码。

六、命令历史记录

[eric@instructor ~]$ history 
    1  touch eric
    2  ls 
    3  ls -Z
    4  cat /etc/group
    5  exit
    6  ls
    7  cp /etc/fstab .
    8  ls
    9  pwd
   10  su root
   11  cd ..
   12  cd .
   13  cd /
   14  ls -a
   15  ls -F
   16  pwd
   17  userdel ?
   18  userdel 
   19  su root
   20  su -
   21  exit
   22  history

如想再次执行历史中存在的记录,则只需要使用“!+序号”,例如执行4

[eric@instructor ~]$ !4
cat /etc/group
root:x:0:
bin:x:1:bin,daemon
daemon:x:2:bin,daemon
sys:x:3:bin,adm
adm:x:4:adm,daemon
tty:x:5:
disk:x:6: