rhel7.2

首先要查看系统信息,确定Linux的版本
kiosk@foundation13 Desktop]$ hostnamectl  ##查看系统信息
   Static hostname: foundation13.ilt.example.com
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: b28fe5aae9454617812a23850159a913
           Boot ID: 6fc6634ec7ee40778e03356cb1a68980
  Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) ##系统版本号Redhat7.2
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.2:GA:server
            Kernel: Linux 3.10.0-327.el7.x86_64
      Architecture: x86-64
-----------------------------------------------------------------------------------
#######虚拟机操作(做实验还是在虚拟机里比较保险)
[kiosk@foundation13 Desktop]$ rht-vmctl start server
Starting server.
[kiosk@foundation13 Desktop]$ rht_vmctl view server
bash: rht_vmctl: command not found...
[kiosk@foundation13 Desktop]$ rht-vmctl view server
[kiosk@foundation13 Desktop]$ rht-vmctl poweroff ##未加虚拟机的名字
Error: missing subcommand or VMNAME.
[kiosk@foundation13 Desktop]$ rht-vmctl poweroff server
Powering off server..
-----------------------------------------------------------------------------------
#######虚拟机操作
[kiosk@foundation13 Desktop]$ rht-vmctl start desktop ##打开虚拟机
Error: desktop not started (is already running) ##错误虚拟机正在运行
[kiosk@foundation13 Desktop]$ rht-vmctl view desktop  ##显示虚拟机
[kiosk@foundation13 Desktop]$ rht-vmctl poweroff desktop ##关闭虚拟机
Powering off desktop.
[kiosk@foundation13 Desktop]$ rht-vmctl view desktop
Error: unable to view desktop - not currently running. ##无法显示,虚拟机未运行
[kiosk@foundation13 Desktop]$ rht-vmctl reset desktop
------------------------------------------------------------------------------------
用户切换
[kiosk@foundation13 Desktop]$ su - root ##切换用户
Password:  ##密码
su: Authentication failure ##-》高- 要密码
[kiosk@foundation13 Desktop]$  ## 无密码
-------------------------------------------------------------------------------------
在非图形界面时(root权限)(当图形界面卡住时,切换至虚拟控制台执行init 3(5)很好用)
init 0 ##关机
init 1 ##单用户模式
init 3 ##关闭图形界面:
init 5 ##打开图形界面:
init 6 ##重新启动
-------------------------------------------------------------------------------------
[kiosk@foundation13 Desktop]$ whatis cal ##查看命令的功能
cal (1)              - display a calendar
cal (1p)             - print a calendar
[kiosk@foundation13 Desktop]$ cal -j 18 11 1984 ##查看这一天是一年中的第几天
       November 1984       
Sun Mon Tue Wed Thu Fri Sat
                306 307 308
309 310 311 312 313 314 315
316 317 318 319 320 321 322
323 324 325 326 327 328 329
330 331 332 333 334 335
[kiosk@foundation13 Desktop]$ cal --help##查看帮助
--------------------------------------------------------------------------------------
[kiosk@foundation13 Desktop]$ date +%H:%M:%S ##注意帮助的提示
14:08:37
[kiosk@foundation13 Desktop]$ date --help  ##注意‘+’
Usage: date [OPTION]... [+FORMAT]
[kiosk@foundation13 Desktop]$ date -d 256day +%m/%d/%y ##注意格式和功能的区别
09/06/17


date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]     ##修改时间后面为格式
date 11111111 ##例子


watch -n 1 date ##每隔一秒执行date
--------------------------------------------------------------------------------------
[kiosk@foundation13 Desktop]$ gnome-session-quit ##注销用户
[kiosk@foundation13 Desktop]$ gnome-session-quit --force ##注销用户,不提示
[kiosk@foundation13 Desktop]$ gnome-terminal ##打开shell用于快捷键制作


--------------------------------------------------------------------------------------
[tab]一下补齐未写完的命令

[tab]两下显示所有的可能的指令


--------------------------------------------------------------------------------------
passwd -S student ##显示student的密码信息
passwd  [student] ##修改密码

Passwd --help  ##查看帮助
--------------------------------------------------------------------------------------
file [fname] ##查看文件的真实的内容
--------------------------------------------------------------------------------------

###################文件的小操作
[kiosk@foundation13 Desktop]$ cat a
[kiosk@foundation13 Desktop]$ head a ##显示前10
[kiosk@foundation13 Desktop]$ head -n 3 a ##显示前3
[kiosk@foundation13 Desktop]$ tail a
[kiosk@foundation13 Desktop]$ tail -n 2 a
[kiosk@foundation13 Desktop]$ less a ##分页显示 /关键字 查找关键字n|N
---------------------------------------------------------------------------------------


你可能感兴趣的:(rhel7.2)