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
---------------------------------------------------------------------------------------


redhat 7.2 可用的yum源, 亲自测试可以使用 ,使用过程: 1.卸载已经存在的yum: rpm -qa | grep yum | xargs rpm -e --nodeps 2.将yum 文件放到server中 3.执行rpm -ivh yum-* 4.创建repo文件: #CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$7 - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch;=$basearch&repo=os baseurl=http://mirrors.163.com/centos/7/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$7 - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch;=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$7 - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch;=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$7 - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 5.测试是否安装成功 yum -y install tree
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值