linux小菜鸟入门,《Linux菜鸟入门》初识linux基础(示例代码)
初識(shí)linux
一 ?進(jìn)入系統(tǒng)
1.用戶(hù)
普通用戶(hù) : student 密碼: student
超級(jí)用戶(hù) : 點(diǎn)擊 not listed
username :root ??password: redhat
在系統(tǒng)中,為了系統(tǒng)的安全性,大部分使用的是普通用戶(hù)。
2.語(yǔ)言調(diào)整
點(diǎn)擊屏幕左上 Application ?點(diǎn)擊 system tools ?setting ?Region&language
3.系統(tǒng)的基礎(chǔ)使用
1》系統(tǒng)登陸
圖形登陸方式:即有畫(huà)面的登陸方式
文本登陸方式:在終端方式下登陸
2》系統(tǒng)關(guān)機(jī),重啟
在終端中輸入
重啟: reboot ?, ?init 6 , ?shutdown -r now
關(guān)機(jī): poweroff , init0 ?, ?shutdown -h now
3》虛擬控制臺(tái)
Ctrl+Alt+F(1|7) 進(jìn)入圖形
Ctrl+Alt+F(2~6) 進(jìn)入虛擬控制臺(tái)
Red hat Enterprise Linux Server 7.0 (Maipo) ?系統(tǒng)版本
Kernel 3.10.0-123.el7.x86_64 on an x86_64 ? 內(nèi)核版本,系統(tǒng)位數(shù)
desktop0 login:root ???????????? 登陸用戶(hù)名稱(chēng)輸入
Password: ????????????????? 密碼輸入無(wú)回顯
4》打開(kāi)終端
①Applications ?Utilities ??Terminal
②鼠標(biāo)右鍵 ?open in terminal
③gnome-terminal
④退出:exit , ctrl+d
kiosk ?????? ? 打開(kāi)shell的用戶(hù)
@ ??????? ? 分隔符
foundation0 ??? ?? 主機(jī)名稱(chēng)
Desktop ?????? 工作目錄名稱(chēng)
$ ??????? 身份提示符,#表示超級(jí)用戶(hù),$表示普通用戶(hù)
⑤注意:命令要在行提示符之后輸入才能執(zhí)行
4.快捷鍵
①. 鎖屏 ??ctrl + alt +L
②. 在終端中
左右鍵 ???????? ? ? ? ? 一個(gè)字符一個(gè)字符移動(dòng)一個(gè)字一個(gè)字移動(dòng)
ctrl+ a ????????????? 光標(biāo)移動(dòng)到行首
ctrl+ e ????????????? 光標(biāo)移動(dòng)到行尾
ctrl+ u ????????????? 光標(biāo)所在位置刪除到行首
ctrl+ r+關(guān)鍵字 ?????????? 調(diào)出最近一條含有關(guān)鍵字的命令
ctrl+ 左|右 ??????????? 光標(biāo)移動(dòng)以單詞為單位
ctrl+ c ????????????? 撤銷(xiāo)以輸入的命令
ctrl+ d ????????????? 關(guān)閉當(dāng)前環(huán)境
ctrl+ shift + t ????????? 在現(xiàn)有shell中重新打開(kāi)一個(gè)table
ctrl+ shift + pageup|pagedown ?? 切換table
ctrl+ alt + l ?????????? 鎖屏
ctrl+ alt +上|下 ????????? 切換工作界面
ctrl+ alt + f1|f7 ???????? 進(jìn)入圖形界面
ctrl+ alt + f2-f6 ???????? 進(jìn)入虛擬控制臺(tái)
5.虛擬機(jī)
[[email?protected] Desktop]$ rht-vmctl start desktop ?????????開(kāi)啟desktop虛擬機(jī)
Error: desktop not started (is already running) ??????????? 報(bào)錯(cuò),desktop已經(jīng)運(yùn)行
[[email?protected] Desktop]$ rht-vmctl view desktop ????????? 顯示desktop
[[email?protected] Desktop]$ rht-vmctl poweroff desktop ??????? 關(guān)閉dekstop
Powering off desktop..
[[email?protected] Desktop]$ rht-vmctl start desktop ?????????開(kāi)啟desktop
Starting desktop.
[[email?protected] Desktop]$ rht-vmctl view desktop
[[email?protected] Desktop]$ rht-vmctl poweroff desktop
Powering off desktop..
[[email?protected] Desktop]$ rht-vmctl view desktop
Error: unable to view desktop - not currently running. ???????虛擬機(jī)沒(méi)開(kāi)啟無(wú)法顯示
二 ?命令
1.學(xué)習(xí)如何查詢(xún)命令
whatis 命令 ?????查看命令的功能
命令 --help ?????查看命令的幫助
[] ?????????????選擇加入的內(nèi)容,可加可不加
... ????????????加入的內(nèi)容個(gè)數(shù)任意
<> ?????????????內(nèi)容在命令執(zhí)行過(guò)程當(dāng)中必須要加
2.使用命令的基本注意事項(xiàng)
1.命令必須在行提示符之后輸入
2.命令格式
命令 參數(shù) 目標(biāo)
3.ctrl +c ??撤銷(xiāo)命名的執(zhí)行
4.命令參數(shù)
-參數(shù) 單詞縮寫(xiě)
--參數(shù) 單詞的全拼
3.簡(jiǎn)單的系統(tǒng)命令
①.date
watch -n 1 date ?????????? 讓date命令每秒執(zhí)行一次,ctrl +c 推出監(jiān)控模式
date 11181115 ??????????? 把系統(tǒng)時(shí)間設(shè)定為11月18日11:15 格式:月月天天小時(shí)分鐘
date 111811152016.55 ????????2016表示年(可以不加).55 表示秒(可以不加)
-d +xday -xday ?????????? 查看x天前或者后的時(shí)間
+%.... ?????????????? 設(shè)定date的輸出格式
②.passwd
1.passwd 修改用戶(hù)密碼
[[email?protected] ~]# passwd ?????????? 改變超級(jí)用戶(hù)密碼
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than 8 characters 密碼不得少于8位
Retype new password:
passwd: all authentication tokens updated successfully.
[[email?protected] 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 ???密碼必須是無(wú)序數(shù)字+字母
New password:
BAD PASSWORD: The password is shorter than 8 characters ??? 密碼必須>8位
2.passwd其他參數(shù)
參數(shù) ??用戶(hù)名稱(chēng)
-S ??用戶(hù)密碼信息
--status 。。。。。。
-l ???鎖定帳號(hào)
-u ???解鎖
-n ?設(shè)定密碼最短有效期
-x ?設(shè)定密碼最長(zhǎng)有效期
-w ???警告期
-i ?設(shè)定用戶(hù)非活躍天數(shù)
-d ?清除用戶(hù)密碼監(jiān)控passwd密碼信息
watch -n 1 passwd -S student
③.file 查看文件類(lèi)型
file 文件名字
④.文件的查看 ##顯示文件的全部?jī)?nèi)容
cat ???顯示一個(gè)文件的前幾行
head ##前五行
head -n 5 ##顯示文件后幾行
tail ##顯示一個(gè)文件的后5行
tail -n 5
⑤.wc統(tǒng)計(jì)文件容量信息
-l ????行數(shù)
-w ????字?jǐn)?shù)
-c ????字節(jié)數(shù)
-m ????字符數(shù)
⑥.history
history ?????????????? 顯示歷史
hostory -c ???????? 清除當(dāng)前環(huán)境當(dāng)中的歷史命令
!數(shù)字 ??????????????執(zhí)行第多少行命令
!字母 ??????????????執(zhí)行最近一條以這個(gè)字母開(kāi)頭的命令
ctrl +R +關(guān)鍵字 ?? ? ? ? 執(zhí)行最近一條含有這個(gè)關(guān)鍵字的命令
上下鍵 ??????????? ?? 逐行調(diào)用命令
本文出自 “12147236” 博客,謝絕轉(zhuǎn)載!
總結(jié)
以上是生活随笔為你收集整理的linux小菜鸟入门,《Linux菜鸟入门》初识linux基础(示例代码)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 基于Three.js、Go语言和Mong
- 下一篇: linux centos7开放端口命令,