linux系统下redhat7之虚拟机控制
基礎操作:
[kiosk@foundation0 Desktop]$ rht-vmctl start desktop?? ??? ?###開啟desktop虛擬機
Error: desktop not started (is already running)?? ??? ??? ??? ?###報錯,desktop已經運行
[kiosk@foundation0 Desktop]$ rht-vmctl view? desktop?? ??? ?###顯示desktop
[kiosk@foundation0 Desktop]$ rht-vmctl poweroff desktop ?? ?###關閉dekstop
Powering off desktop..?? ??? ??? ?
[kiosk@foundation0 Desktop]$ rht-vmctl start desktop ?? ??? ?###開啟desktop
Starting desktop.
[kiosk@foundation0 Desktop]$ rht-vmctl view desktop
[kiosk@foundation0 Desktop]$ rht-vmctl poweroff desktop
Powering off desktop..
[kiosk@foundation0 Desktop]$ rht-vmctl view desktop
Error: unable to view desktop - not currently running.?? ??? ?###虛擬機沒開啟無法顯示
[kiosk@foundation0 Desktop]$ rht-vmctl reset desktop ?? ??? ?###當虛擬機出現故障,reset表示重置
Are you sure you want to reset desktop? (y/n) y?? ??? ??? ??? ?###詢問是否重置y表示yes
Resetting desktop.?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?##正在重置
Powering off desktop..
?
進入系統:
*)普通用戶登陸
student 普通用戶,密碼student
*)超級用戶登陸
->not listed ?? ??? ?點擊未列出
username?? ??? ??? ?提示輸入用戶名稱
->root?? ??? ??? ??? ?root為系統超級用戶
passwd?? ??? ??? ??? ?提示輸入密碼
->redhat?? ??? ??? ?redhat是超級用戶密碼?? ?
###語言調整#####
Applications??? ----->system tools---->settings ----->Region & language --->language
打開命令行---> reboot
?
1.行提示符
[kiosk@foundation0 Desktop]$
kiosk?? ??? ? ? ? ? ? ? ? ##打開shell的用戶
@?? ??? ??? ??? ?????????? ##分隔符
foundation0?? ???? ##主機名稱
Desktop?? ??? ??? ?? ##工作目錄名稱
$?? ??? ??? ??? ???????? ? ##身份提示符,$表示普通用戶
#???????????????????????? ##表示超級用戶
注意:命令要在行提示符之后輸入才能執行
2.切換用戶
[kiosk@foundation0 Desktop]$ su - username
*)高級用戶切換到低級用戶不需要密碼,低級用戶切換到高級或者平級用戶的切換需要密碼
3.虛擬控制臺
Ctrl+Alt+F(1|7)?? ?進入圖形
Ctrl+Alt+F(2~6) 進入虛擬控制臺
查看系統版本:
[root@foundation1 ~]# uname -a
Linux foundation1 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
?
Red hat Enterprise Linux Server 7.0 (Maipo)?? ?##系統版本
Kernel 3.10.0-123.el7.x86_64 on an x86_64?? ?##內核版本,系統位數
desktop0 login:root?? ??? ??? ??? ??? ??? ?##登陸用戶名稱輸入
Password:?? ??? ??? ??? ??? ??? ??? ??? ??? ?##密碼輸入無回顯
4.命令的執行
1.命令必須在行提示符之后輸入
2.命令格式
命令 參數 目標
3.ctrl +c?? ??? ??? ?##撤銷命名的執行
4.命令參數
-參數?? ??? ??? ??? ?##單詞縮寫
--參數?? ??? ??? ??? ?##單詞的全拼
5.命令的幫助
1. man
man??? ->>manual?? ?###man是手冊縮寫
man man?? ??? ?????????? ###查看man命令的幫助
man passwd?? ??? ???? ###查看passwd命令的幫助
man頁面的快捷方式
上下鍵?? ??? ??? ? ? ??? ##向上或向下一行
pageup|pagedown?? ??? ?##向下一個屏幕或者向上一個屏幕
d|u?? ??? ??? ? ? ? ??????? ##向下或者向上半個屏幕
G|gg?? ??? ??? ? ? ? ? ? ##跳轉頁面到man最下面或最上面
/關鍵字?? ??? ??? ? ?? ##搜索關鍵字,關鍵字會高亮顯示,n向下匹配,N向上
q?? ??? ?? ? ? ? ? ? ? ? ? ##退出幫助頁面
6.系統的使用基礎方法
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
4)系統關機,重啟
重啟
reboot | init 6 |shutdown -r now
關機
poweroff | init 0 | shutdown -h now
5)鎖屏
ctrl + alt +L?? ??? ?##在rhel7.0
win鍵 + L?? ??? ??? ?##在rhel7.2
7.簡單的系統命令
1) date
watch -n 1 date ?? ??? ?????????????????????????? ###讓date命令每秒執行一次,ctrl +c 推出監控模式
[root@server1 ~]# date 02142008
Thu Feb 14 20:08:00 EST 2019 ? ? ? ? ? ? ? ? ? ? ?? ###把系統時間設定為2月14日20:08格式:月月天天小時分鐘
[root@server1 ~]# date 021420122019.20
Thu Feb 14 20:12:20 EST 2019???????????????????????? ###2019表示年(可以不加).55 表示秒(可以不加)
-d +xday -xday?? ????????????????? ###查看x天前或者后的時間
+%....?? ??? ??? ??? ?##設定date的輸出格式
2)passwd
1.passwd 修改用戶密碼
[root@foundation0 ~]# 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@foundation0 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?? ??? ?##用戶密碼信息
?? ?--status student?? ??? ?。。。。。。
?? ?-l?? ?student?? ??? ?##鎖定帳號
?? ?-u?? ?student?? ??? ?##解鎖
?? ?-n 1?? ?student?? ??? ?##設定密碼最短有效期
?? ?-x 30?? ?student?? ??? ?##設定密碼最長有效期
?? ?-w 3?? ?student?? ??? ?##警告期
?? ?-i 2?? ?student?? ??? ?##設定用戶非活躍天數
?? ?-d?? ?student?? ??? ?##清除用戶密碼
?
[root@server1 ~]# watch -n 1 passwd -S root?????????????????????? ###監控passwd密碼信息
[root@server1 ~]# passwd -S root???????????????????? ##用戶密碼信息
root PS 2018-12-26 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@server1 ~]# passwd -d root???????????????????? ##清除用戶密碼
Removing password for user root.
passwd: Success
[root@server1 ~]# 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.
3)file
file 文件名字?? ?##查看文件類型
4)文件的查看
cat?? ??? ?filename?? ?##顯示文件的全部內容
less?? ??? ?file?? ??? ?##分頁瀏覽,按“q”退出
head?? ??? ?filename?? ?##顯示一個文件的前幾行
head -n 5?? ?filename?? ?##前五行
tail?? ??? ?filename?? ?##顯示文件后幾行
tail -n 5 ?? ?filename?? ?##顯示一個文件的后5行
5)wc統計文件容量信息
wc?? ?-l?? ?行數
?? ?-w?? ?字數
?? ?-c?? ?字節數
?? ?-m?? ?字符數
8.tab鍵
在系統中table鍵可以自動補齊存在的命令,文件名稱和某些命令的參數
9.history歷史調用
history?? ??? ??? ?##顯示歷史
hostory -c?? ??? ?##清除當前環境當中的歷史命令
!數字?? ??? ??? ?##執行第多少行命令
!字母?? ??? ??? ?##執行最近一條以這個字母開頭的命令
ctrl +R +關鍵字?? ?##切換table?? ?##執行最近一條含有這個關鍵字的命令
上下鍵?? ??? ??? ?##逐行調用命令
10.linux中的快捷鍵
左右?? ??? ??? ??? ?##一個字符一個字符移動
ctrl +左右?? ??? ??? ?##一個字一個字移動
ctrl + a??? ??? ?##光標移動到行首
?????? + e??? ??? ?##光標移動到行尾
?????? + u??? ??? ?##光標所在位置刪除到行首
?????? + k??? ??? ?##光標所在位置刪除到行尾
?????? + r+關鍵字?? ?##調出最近一條含有關鍵字的命令
?????? + c??? ??? ?##撤銷以輸入的命令
?????? + d??? ??? ?##關閉當前環境
?????? + L?? ??? ??? ??? ?##清空屏幕
?? ??? + shift + c?? ??? ?##復制
?? ??? + shift + v?? ??? ?##粘貼
?????? + shift + t ?? ?##在現有shell中重新打開一個table
?? ??? + shift + n?? ??? ??? ?##在shell中打
?????? + alt +上|下??? ##切換工作界面
?????? + alt + f1|f7?? ##進入圖形界面
?????? + alt + f2-f6?? ##進入虛擬控制臺
總結
以上是生活随笔為你收集整理的linux系统下redhat7之虚拟机控制的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iptables防火墙策略
- 下一篇: Linux之redhat7系统结构