零。目錄
一。文件和目錄類
- 文件存在文件已經(jīng)存在
- 沒有這樣的文件或目錄沒有這個(gè)文件或目錄(這個(gè)東西不存在)
- 命令未找到命令找不到(沒有這個(gè)命令)
- 無效選項(xiàng)無效的參數(shù)(不可用的參數(shù))
- 覆蓋覆蓋
- 刪除常規(guī)空文件是否刪除普通文件(空的)?
- 是一個(gè)目錄xxx是一個(gè)目錄
- 進(jìn)入目錄是否進(jìn)入目錄
- 無效級(jí)別無效的層數(shù)择示,層數(shù)必須大于0
- 無法打開文件寫無法打開這個(gè)文件
- 自上次改變以來沒有寫
- xx列窗口太窄窗口只有xx列太太了無法完全顯示
- xxx不是目錄不是一個(gè)目錄
- 查看壓縮包的時(shí)候報(bào)錯(cuò)
- 您有/ var / spool / mail / root中的郵件
- 沒有權(quán)限
- 警告:更改只讀文件
- 設(shè)置'readonly'選項(xiàng)(添加!覆蓋)
二。網(wǎng)絡(luò)連接類
- 遠(yuǎn)程連接錯(cuò)誤連接失敗連接失敗
- yum安裝軟件故障提示無法解析主機(jī)無法解析主機(jī)
- yum安裝軟件提示:無事可做(沒事做)
- 沒有找到叫treea的軟件包
- 姓名或服務(wù)未知域名無法識(shí)別(無法上網(wǎng))
三榛丢。修改系統(tǒng)基礎(chǔ)配置類
- 重啟網(wǎng)卡報(bào)錯(cuò)設(shè)備不存在
- 修改主機(jī)名過程中,命令行中主機(jī)名沒有變化
- hostname命令修改主機(jī)名(臨時(shí)重啟服務(wù)器之后失效)
- 命令行中的主機(jī)名部分沒有改變挺庞?
四晰赞。用戶相關(guān)錯(cuò)誤
- 用戶'lcx'已經(jīng)存在
- 沒有這樣的用戶
- 只有root才能做到這一點(diǎn)。
- 只有root才能指定用戶名选侨。
- 創(chuàng)建郵箱文件:文件存在
- 警告:主目錄已存在掖鱼。
一。文件和目錄類
1.文件存在文件已經(jīng)存在
[root@lcx01 ~]# mkdir /data /lidao
[root@lcx01 ~]# mkdir /data /lidao
mkdir: cannot create directory ‘/data’: File exists
mkdir: cannot create directory ‘/lidao’: File exists
mkdir:無法創(chuàng)建目錄'/ lidao':文件存在
無法創(chuàng)建目錄因?yàn)檫@個(gè)目錄已經(jīng)存在
2.沒有這樣的文件或目錄沒有這個(gè)文件或目錄(這個(gè)東西不存在)
沒有這個(gè)目錄:文件或路徑書寫錯(cuò)誤
[root@lcx01 ~]# mkdir /lcx
[root@lcx01 ~]# cd lcx
-bash: cd: lcx: No such file or directory
mkdir命令本身問題:mkdir命令默認(rèn)只能創(chuàng)建1層目錄創(chuàng)建多層報(bào)錯(cuò)
-p解決方案
[root@lcx01 ~]# mkdir /data/lcx/lidao/
mkdir: cannot create directory ‘/data/lcx/lidao/’: No such file or directory
觸摸命令只能創(chuàng)建文件援制,不目錄存在則會(huì)報(bào)錯(cuò)
解決:先創(chuàng)建目錄戏挡,再創(chuàng)建文件
[root@lcx01 ~]# ls /lcx/
lcx.txt
[root@lcx01 ~]# touch /lcx/lidao/alex/lcx.txt
touch: cannot touch ‘/lcx/lidao/alex/lcx.txt’: No such file or directory
排錯(cuò)思路:
1.ls命令檢查對(duì)應(yīng)的目錄是否存在?
2.目錄不存在先創(chuàng)建目錄在創(chuàng)建文件/
3.命令未找到命令找不到(沒有這個(gè)命令)
[root@lcx01 ~]# mkdiy
-bash: mkdiy: command not found
1.書寫錯(cuò)誤
2.沒有安裝
4.無效選項(xiàng)無效的參數(shù)(不可用的參數(shù))
[root@lcx01 ~]# touch -p /lcx/lcx.txt
touch: invalid option -- 'p'
Try 'touch --help' for more information.
5.覆蓋覆蓋
CP復(fù)制如果已經(jīng)存在這個(gè)文件會(huì)提示是否覆蓋
[root@lcx01 ~]# cp /lcx/lcx.txt /tmp/
cp: overwrite ‘/tmp/lcx.txt’?
6.刪除常規(guī)空文件是否刪除普通文件(空的)晨仑?
[root@lcx01 ~]# rm /lcx/lcx.txt
rm: remove regular empty file ‘/lcx/lcx.txt’?
7.是目錄xxx是一個(gè)目錄
rm默認(rèn)無法刪除目錄
解決:加上-r或-rf
[root@lcx01 ~]# rm /data/
rm: cannot remove ‘/data/’: Is a directory
vi命令中使用vi編輯目錄也會(huì)報(bào)錯(cuò)
"/lcx"
E502: "/lcx" is a directory
Press ENTER or type command to continue
8.進(jìn)入目錄是否進(jìn)入目錄
[root@lcx01 ~]# rm -r /data/
rm: descend into directory ‘/data/’? y
rm: remove regular empty file ‘/data/lcx01.txt’? n
rm: remove regular empty file ‘/data/lcx02.txt’? n
rm: remove regular empty file ‘/data/lcx03.txt’? n
rm: remove regular empty file ‘/data/lcx04.txt’? n
rm: remove regular empty file ‘/data/lcx05.txt’? n
rm: remove regular empty file ‘/data/lcx06.txt’? n
rm: remove regular empty file ‘/data/lcx07.txt’? n
rm: remove regular empty file ‘/data/lcx08.txt’? n
rm: remove regular empty file ‘/data/lcx09.txt’? n
rm: remove regular empty file ‘/data/lcx10.txt’? n
rm: remove directory ‘/data/’? n
9.無效級(jí)別無效的層數(shù)褐墅,層數(shù)必須大于0
注意參數(shù)位置
[root@lcx01 ~]# tree -L -F 2 /
tree: Invalid level, must be greater than 0.
10.無法打開文件寫入無法打開這個(gè)文件
vi中如果目錄不存在就會(huì)提示
"/lcx/lcx.txt"
"/lcx/lcx.txt" E212: Can't open file for writing
Press ENTER or type command to continue
11.自上次更改以來沒有寫
E37: No write since last change (add ! to override)
粘包賴(你修改了內(nèi)容就無法使用:q退出 需要使用:q!
12. xx列窗口太窄窗口只有xx列太太了無法完全顯示
這是w的坑空間太小施展不開拆檬。
[root@lcxedu60-lnb ~]# w
w: 39 column window is too narrow
13. xxx不是目錄不是一個(gè)目錄
背景:創(chuàng)建文件的時(shí)候多了一個(gè)空格
[root@ssdz ~]# touch /lcx /lcx.txt #此處要?jiǎng)?chuàng)建/lcx/lcx.txt 多個(gè)個(gè)空格 創(chuàng)建了2個(gè)文件 /lcx和/lcx.txt
[root@ssdz ~]# ls -l /lcx/ #系統(tǒng)認(rèn)為lcx是個(gè)目錄 所以報(bào)錯(cuò)
ls: cannot access /lcx/: Not a directory
[root@ssdz ~]# touch /lcx/lcx.txt
touch: cannot touch ‘/lcx/lcx.txt’: Not a directory
[root@ssdz ~]# ls -l /lcx
-rw-r--r--. 1 root root 0 Apr 9 15:23 /lcx
14.查看壓縮包的時(shí)候報(bào)錯(cuò)
注意是否有特殊中文符號(hào)導(dǎo)致的。
[root@lcx01 tmp]# tar ztf /tmp/etc.tar.gz
tar (child): \200\202\200\202\200\202\200\202/tmp/etc.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
15.您在/ var / spool / mail / root中有郵件
你在這個(gè)文件/ var / spool / mail / root中有一個(gè)新郵件
16.許可被拒絕
權(quán)限拒絕
17. W10:警告:更改只讀文件
使用vim的時(shí)候的顯示的
表示:修改正在只讀文件
解決:1.查看對(duì)文件是否有RW權(quán)限
2.如果是根用戶可以修改后強(qiáng)制保存退出(:WQM椎省)
18.找不到格式正確的MD5校驗(yàn)和行
在使用md5sum -c(檢查的時(shí)候)
md5指紋信息文件中竟贯,格式不對(duì)
第1列是md5信息第2列文件名
解決方案:查看MD5文件內(nèi)容是否正確
檢查的命令是否正確md5sum -c lcx.md5
md5sum: /lcx/mtime/access_2019-04-01.txt: no properly formatted MD5 checksum lines found
19. E45:設(shè)置'readonly'選項(xiàng)(添加!覆蓋)
通過vi / vim編輯文件保存的時(shí)候(:wq)提示
這個(gè)文件只讀逝钥,:wq澄耍!強(qiáng)制保存退出
二、網(wǎng)絡(luò)連接類
1.遠(yuǎn)程連接錯(cuò)誤連接失敗連接失敗
使用XSHELL遠(yuǎn)程連接失敗提示晌缘,檢查端口是否開啟或正確
[c:\~]$
Connecting to 10.0.0.200:233...
Could not connect to '10.0.0.200' (port 233): Connection failed.
Type `help' to learn how to use Xshell prompt.
使用的telnet測(cè)試端口是否打開
[c:\~]$ telnet 10.0.0.200 233
Connecting to 10.0.0.200:233...
Could not connect to '10.0.0.200' (port 233): Connection failed. #233端口沒有開啟
Type `help' to learn how to use Xshell prompt.
端口開啟
[c:\~]$ telnet 10.0.0.200 22
Connecting to 10.0.0.200:22...
Connection established. #端口開啟
To escape to local shell, press 'Ctrl+Alt+]'.
SSH-2.0-OpenSSH_7.4
Protocol mismatch.
Connection closed by foreign host.
Disconnected from remote host(10.0.0.200:22) at 12:22:54.
Type `help' to learn how to use Xshell prompt.
[c:\~]$
2. yum安裝軟件故障提示無法解析主機(jī)無法解析主機(jī)
無法解析主機(jī)無法解析主機(jī)
主要是系統(tǒng)能否上網(wǎng)和DNS問題齐莲。
http://mirrors.tuna.tsinghua.edu.cn/centos/7.6.1810/updates/x86_64/repodata/repomd.xml: [Errno 14] curl#6 -
"Could not resolve host: mirrors.tuna.tsinghua.edu.cn; Unknown error"
Trying other mirror.
3.yum安裝軟件提示:無事可做(沒事做)
有兩種情況:
情況1:軟件已經(jīng)安裝并且最新如下:
Package tree-1.6.0-10.el7.x86_64 already installed and latest version
tree軟件包已經(jīng)安裝并且是最新版本
Package 2:vim-enhanced-7.4.160-5.el7.x86_64 already installed and latest version
Package 1:bash-completion-2.1-6.el7.noarch already installed and latest version
Nothing to do
情況2:軟件名字寫錯(cuò)或沒有配置蔭源導(dǎo)致找不到這個(gè)軟件包
[root@lcxedu60-lnb ~]# yum install treea -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.lzu.edu.cn
* extras: mirrors.nwsuaf.edu.cn
* updates: mirrors.nwsuaf.edu.cn
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
No package treea available.
#沒有找到叫treea的軟件包
Error: Nothing to do
情況3:你需要安裝軟件包而不是軟件包里面的命令
通過yum提供查看命令屬于哪個(gè)軟件包
[root@lcx01 ~]# yum install -y locate
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): extras/7/x86_64/primary_db | 187 kB 00:00:02
(2/2): updates/7/x86_64/primary_db | 3.4 MB 00:00:04
No package locate available.
Error: Nothing to do
[root@lcx01 ~]# yum provides locate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base/7/x86_64/filelists_db | 7.1 MB 00:00:03
extras/7/x86_64/filelists_db | 236 kB 00:00:00
updates/7/x86_64/filelists_db | 2.7 MB 00:00:01
mlocate-0.26-8.el7.x86_64 : An utility for finding files by name
Repo : base
Matched from:
Filename : /usr/bin/locate\
[root@lcx01 ~]# yum install -y mlocate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package mlocate.x86_64 0:0.26-8.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================
Installing:
mlocate x86_64 0.26-8.el7 base 113 k
Transaction Summary
=========================================================================================================================
Install 1 Package
Total download size: 113 k
Installed size: 379 k
Downloading packages:
mlocate-0.26-8.el7.x86_64.rpm | 113 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mlocate-0.26-8.el7.x86_64 1/1
Verifying : mlocate-0.26-8.el7.x86_64 1/1
Installed:
mlocate.x86_64 0:0.26-8.el7
Complete!
[root@lcx01 ~]# rpm -qa mlocate
mlocate-0.26-8.el7.x86_64
4.名稱或服務(wù)未知域名無法識(shí)別(無法上網(wǎng))
原因1:DNS配置錯(cuò)誤
原因2:Linux無法上網(wǎng)原因http://www.reibang.com/p/0bc0b596c1a0
[root@lcx01 ~]# ping baidu.com
ping: baidu.com: Name or service not known
域名無法識(shí)別(無法將域名---->ip地址)
三。修改系統(tǒng)基礎(chǔ)配置類
1.重啟網(wǎng)卡報(bào)錯(cuò)設(shè)備不存在
[root@lcxusd ~]# systemctl restart network
Job for network.service failed because the control process exited with error code.
See "systemctl status network.service" and "journalctl -xe" for details.
查看詳細(xì)錯(cuò)誤原因
·journalctl -xe·
Apr 01 15:31:05 lcxusd.1 network[7816]: Bringing up interface etho:
ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device does not seem to be present, delaying initialization.
Apr 01 15:31:05 lcxusd.1 /etc/sysconfig/network-scripts/ifup-eth[8019]:
Device does not seem to be present, delaying initializatio
2.修改主機(jī)名過程中磷箕,命令行中主機(jī)名沒有變化
1#hostname命令修改主機(jī)名(臨時(shí)重啟服務(wù)器之后失效)
[root@lcx01 ~]# hostname
lcx01
[root@lcx01 ~]# hostname lcx01-lnb
2#修改文件內(nèi)容(寫合同永久重啟服務(wù)器之后生效)
vim /etc/hostname
lcx01-lnb
3#檢查
[root@lcx01 ~]# hostname
lcx01-lnb
[root@lcx01 ~]# cat /etc/hostname
lcx01-lnb
命令行中的主機(jī)名部分沒有改變选酗?
解決:重新登錄下即可(斷開連接,重新連接)
[root@lcx01-lnb ~]#
3.尋找匹配的“”時(shí)意外的EOF
引號(hào)不成對(duì)
tail -2 /etc/profile
alias net="cat /etc/sysconfig/network-scripts/ifcfg-eth0
export PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "
[root@ssdz ~]# source /etc/profile
-bash: /etc/profile: line 78: unexpected EOF while looking for matching `"'
-bash: /etc/profile: line 79: syntax error: unexpected end of file
-bash:/ etc / profile:第78行:意外的EOF岳枷,同時(shí)尋找匹配的`''
/ etc / profile第78行出乎意料的結(jié)尾正在找'''這個(gè)雙引號(hào)的另一半
四芒填。用戶類錯(cuò)誤
用戶'lcx'已經(jīng)存在
用戶已經(jīng)存在
[root@lcx01 ~]# useradd lcx
useradd: user 'lcx' already exists
2.沒有這樣的用戶
沒有這個(gè)用戶
[root@lcx01 ~]# id lidao
id: lidao: no such user
3.只有root才能做到這一點(diǎn)。
只有root用戶可以使用非交互式設(shè)置密碼方式
[lcx@lcx01 ~]$ echo 123456|passwd --stdin lcx
Only root can do that.
4.Only root可以指定用戶名空繁。
只有root用戶運(yùn)行passwd的時(shí)候后面能加上用戶名
普通用戶默認(rèn)只能運(yùn)行passwd不能加用戶名修改自己的密碼
[lcx@lcx01 ~]$ passwd lcx
passwd: Only root can specify a user name.
5.創(chuàng)建郵箱文件:文件存在和警告:主目錄已存在殿衰。
添加用戶的時(shí)候提示:
創(chuàng)建郵箱文件:文件存在正在創(chuàng)建這個(gè)用戶的郵箱:郵箱
已經(jīng)存在警告:主目錄已經(jīng)存在。這個(gè)用戶的家目錄已經(jīng)存在
刪除用戶的時(shí)候盛泡,默認(rèn)不刪除家目錄和郵箱闷祥。
再次添加就會(huì)提示家目錄存在和郵箱存在
[root@lcx01 ~]# id stu01
uid=1005(stu01) gid=1006(stu01) groups=1006(stu01)
[root@lcx01 ~]# userdel stu01
[root@lcx01 ~]# useradd stu01
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Creating mailbox file: File exists
```f