目录

一。文件和目录类

  • 文件存在文件已经存在
  • 没有这样的文件或目录没有这个文件或目录(这个东西不存在)
  • 命令未找到命令找不到(没有这个命令)
  • 无效选项无效的参数(不可用的参数)
  • 覆盖覆盖
  • 删除常规空文件是否删除普通文件(空的)?
  • 是一个目录xxx是一个目录
  • 进入目录是否进入目录
  • 无效级别无效的层数,层数必须大于0
  • 无法打开文件写无法打开这个文件
  • 自上次改变以来没有写
  • xx列窗口太窄窗口只有xx列太太了无法完全显示
  • xxx不是目录不是一个目录
  • 查看压缩包的时候报错
  • 您有/ var / spool / mail / root中的邮件
  • 没有权限
  • 警告:更改只读文件
  • 设置’readonly’选项(添加!覆盖)

二。网络连接类

  • 远程连接错误连接失败连接失败
  • yum安装软件故障提示无法解析主机无法解析主机
  • yum安装软件提示:无事可做(没事做)
  • 没有找到叫treea的软件包
  • 姓名或服务未知域名无法识别(无法上网)

三。修改系统基础配置类

  • 重启网卡报错设备不存在
  • 修改主机名过程中,命令行中主机名没有变化
  • hostname命令修改主机名(临时重启服务器之后失效)
  • 命令行中的主机名部分没有改变?

四。用户相关错误

  • 用户’lcx’已经存在
  • 没有这样的用户
  • 只有root才能做到这一点。
  • 只有root才能指定用户名。
  • 创建邮箱文件:文件存在
  • 警告:主目录已存在。

一。文件和目录类

1.文件存在文件已经存在

[root@lcx ~]# mkdir   /data   /lidao
[root@lcx ~]# mkdir   /data   /lidao
mkdir: cannot create directory ‘/data’: File exists
mkdir: cannot create directory ‘/lidao’: File exists

mkdir:无法创建目录’/ lidao’:文件存在
无法创建目录因为这个目录已经存在

2.没有这样的文件或目录没有这个文件或目录(这个东西不存在)

没有这个目录:文件或路径书写错误

[root@lcx ~]# mkdir  /lcx
[root@lcx ~]# cd lcx
-bash: cd: lcx: No such file or directory

mkdir命令本身问题:mkdir命令默认只能创建1层目录创建多层报错
-p解决方案

[root@lcx ~]# mkdir  /data/lcx/lidao/
mkdir: cannot create directory ‘/data/lcx/lidao/’: No such file or directory

触摸命令只能创建文件,不目录存在则会报错
解决:先创建目录,再创建文件

[root@lcx ~]# ls /lcx/
lcx.txt
[root@lcx ~]# touch /lcx/lidao/alex/lcx.txt
touch: cannot touch ‘/lcx/lidao/alex/lcx.txt’: No such file or directory

排错思路:
1.ls命令检查对应的目录是否存在?
2.目录不存在先创建目录在创建文件/

3.命令未找到命令找不到(没有这个命令)

[root@lcx ~]# mkdiy
-bash: mkdiy: command not found

1.书写错误
2.没有安装

4.无效选项无效的参数(不可用的参数)

 [root@lcx ~]# touch -p /lcx/lcx.txt
touch: invalid option -- 'p'
Try 'touch --help' for more information.

5.覆盖覆盖

CP复制如果已经存在这个文件会提示是否覆盖

[root@lcx ~]# cp  /lcx/lcx.txt   /tmp/
cp: overwrite ‘/tmp/lcx.txt’? 

6.删除常规空文件是否删除普通文件(空的)?

[root@lcx ~]# rm   /lcx/lcx.txt
rm: remove regular empty file ‘/lcx/lcx.txt’?

7.是目录xxx是一个目录

rm默认无法删除目录
解决:加上-r或-rf

[root@lcx ~]# rm /data/
rm: cannot remove ‘/data/’: Is a directory

vi命令中使用vi编辑目录也会报错

"/lcx"
E502: "/lcx" is a directory
Press ENTER or type command to continue

8.进入目录是否进入目录

[root@lcx ~]# 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.无效级别无效的层数,层数必须大于0

注意参数位置

[root@lcx ~]# tree  -L -F 2 /
tree: Invalid level, must be greater than 0.

10.无法打开文件写入无法打开这个文件

vi中如果目录不存在就会提示

"/oldbyo/lcx.txt"
"/oldbyo/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)粘包赖(你修改了内容就无法使用:q退出 需要使用:q! 

12. xx列窗口太窄窗口只有xx列太太了无法完全显示

这是w的坑空间太小施展不开。

[root@lcx60-lnb ~]# w
w: 39 column window is too narrow

13. xxx不是目录不是一个目录

背景:创建文件的时候多了一个空格

[root@ssdz ~]# touch /lcx /lcx.txt  #此处要创建/lcx/lcx.txt 多个个空格 创建了2个文件 /lcx和/lcx.txt
[root@ssdz ~]# ls -l /lcx/         #系统认为lcx是个目录 所以报错
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.查看压缩包的时候报错

注意是否有特殊中文符号导致的。

[root@lcx59 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中有邮件

你在这个文件/ var / spool / mail / root中有一个新邮件

16.许可被拒绝

权限拒绝

17. W10:警告:更改只读文件

使用vim的时候的显示的
表示:修改正在只读文件
解决:

1.查看对文件是否有RW权限
2.如果是根用户可以修改后强制保存退出(:WQ!)

18.找不到格式正确的MD5校验和行

在使用md5sum -c(检查的时候)
md5指纹信息文件中,格式不对
第1列是md5信息第2列文件名
解决方案:

查看MD5文件内容是否正确
检查的命令是否正确md5sum -c lcx.md5

md5sum: /lcx/mtime/access_2019-04-01.txt: no properly formatted MD5 checksum lines found

19. E45:设置’readonly’选项(添加!覆盖)

通过vi / vim编辑文件保存的时候(:wq)提示
这个文件只读,:wq!强制保存退出

二、网络连接类

1.远程连接错误连接失败连接失败

使用XSHELL远程连接失败提示,检查端口是否开启或正确

[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:\~]$ 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.4Protocol 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安装软件故障提示无法解析主机无法解析主机

无法解析主机无法解析主机
主要是系统能否上网和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:软件已经安装并且最新如下:

Package tree-1.6.0-10.el7.x86_64 already installed and latest version
tree软件包已经安装并且是最新版本
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:软件名字写错或没有配置荫源导致找不到这个软件包

[root@lcx60-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提供查看命令属于哪个软件包

[root@lcx ~]# 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@lcx ~]# 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@lcx ~]# 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 ResolutionDependencies Resolved=========================================================================================================================Package                     Arch                       Version                           Repository                Size
=========================================================================================================================
Installing:mlocate                     x86_64                     0.26-8.el7                        base                     113 kTransaction Summary
=========================================================================================================================
Install  1 PackageTotal 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 transactionInstalling : 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@lcx ~]# rpm -qa mlocate
mlocate-0.26-8.el7.x86_64

4.名称或服务未知域名无法识别(无法上网)

原因1:DNS配置错误
原因2:Linux无法上网原因https://www.jianshu.com/p/0bc0b596c1a0

[root@lcx ~]# ping baidu.com
ping: baidu.com: Name or service not known域名无法识别(无法将域名---->ip地址)

三。修改系统基础配置类

1.重启网卡报错设备不存在

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

查看详细错误原因
·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.修改主机名过程中,命令行中主机名没有变化

1#hostname命令修改主机名(临时重启服务器之后失效)

[root@lcx ~]# hostname
lcx
[root@lcx ~]# hostname lcx-lnb 

2#修改文件内容(写合同永久重启服务器之后生效)

vim /etc/hostname lcx-lnb

3#检查

[root@lcx ~]# hostname
lcx-lnb
[root@lcx ~]# cat /etc/hostname
lcx-lnb

4 # 命令行中的主机名部分没有改变?

解决:重新登录下即可(断开连接,重新连接)

[root@lcx-lnb ~]#

3.寻找匹配的“”时意外的EOF

引号不成对

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,同时寻找匹配的`’’
/ etc / profile第78行出乎意料的结尾正在找’’'这个双引号的另一半

四。用户类错误

用户’lcx’已经存在

用户已经存在

[root@lcx ~]# useradd lcx
useradd: user 'lcx' already exists

2.没有这样的用户

没有这个用户

[root@lcx ~]# id lidao
id: lidao: no such user

3.只有root才能做到这一点。

只有root用户可以使用非交互式设置密码方式

[lcx@lcx ~]$ echo 123456|passwd --stdin lcx
Only root can do that.

4.Only root可以指定用户名。

只有root用户运行passwd的时候后面能加上用户名
普通用户默认只能运行passwd不能加用户名修改自己的密码

[lcx@lcx ~]$ passwd lcx
passwd: Only root can specify a user name.

5.创建邮箱文件:文件存在和警告:主目录已存在。

添加用户的时候提示:

创建邮箱文件:文件存在正在创建这个用户的邮箱:邮箱
已经存在警告:主目录已经存在。这个用户的家目录已经存在

删除用户的时候,默认不删除家目录和邮箱。
再次添加就会提示家目录存在和邮箱存在

[root@lcx ~]# id stu01
uid=1005(stu01) gid=1006(stu01) groups=1006(stu01)
[root@lcx ~]# userdel stu01
[root@lcx ~]# useradd stu01
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Creating mailbox file: File exists

[故障集合] Linux的必遇到的故障及原因相关推荐

  1. linux 内存耗尽重启,【server故障】linux下JVM内存耗尽故障

    – 环境:linux RHL 7.5 – Tableau Server:2019.1 今天客户咨询一个问题,在访问8850后台时,提示出现以下错误: Whitelabel Error Page Thi ...

  2. 详细图文演示——排除启动类故障以及Linux操作系统引导、运行级别和优化启动等相关知识

    详细图文演示--排除启动类故障以及Linux操作系统引导.运行级别和优化启动等相关知识 一.Linux操作系统引导过程 1.开机自检 2.MBR 引导 3.GRUB菜单 4.加载Linux内核 5.i ...

  3. linux 安装git失败,Linux运维知识之linux下安装git常见故障整理

    本文主要向大家介绍了Linux运维知识之linux下安装git常见故障整理,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助. FAQ1: Permission denied (pu ...

  4. 浅谈linux系统下常见的故障与处理方法

    与windows系统一样,linux操作系统也会存在很多问题和故障,很多linux新手都害怕故障,面对出现的问题显得无可奈何,更有甚者,由此放弃了linux,其实,我们不应该惧怕问题,学习就是一个发现 ...

  5. Linux菜鸟必知必会的命令集合

    下面是我用到过的Linux命令,也可以说是Linux菜鸟必知必会的命令集合,基本上占据了所有你将用到的命令的95%以上,值得一看.     一: Linux下的mysql数据库常用操作 1.登入登出 ...

  6. linux root 密码 鉴定故障,linux的su命令鉴定故障

    linux下的su命令有时会出现鉴定故障的问题该怎么解决呢?下面由学习啦小编为大家搜集整理了linux的su命令鉴定故障的相关知识,希望对大家有帮助! linux的su命令鉴定故障一 情况一 有两个用 ...

  7. Linux系统引导过程及故障排除

    Linux系统引导过程及故障排除 一.Linux操作系统引导过程 二.系统初始化进程 三.排除启动类故障 (一)修复MBR扇区故障 (二)修复GRUB引导故障 (四)遗忘root用户的密码 一.Lin ...

  8. Linux内存卡槽故障判断,内存插槽损坏的三种常见故障

    内存可以说是计算机中故障最频繁的部件之一.由于内存故障的表现是比较直接的,所以我们在维护的时候不用花太多时间去判断故障的来源.一般情况下,只要更换一个新的内存条,如果机器能够顺利启动并稳定运行,就可以 ...

  9. 常见PLC故障集合及排除方法

    正如我们的电工同事所知,在目前的企业工厂中,plc在自动化控制中发挥了重要作用,并且有完全取代传统继电器控制的巨大趋势.虽然PLC的故障率很低,但由于产品质量和使用寿命的问题,偶尔出现的问题会给生产带 ...

最新文章

  1. c++exe程序在别人电脑上双击无法打开_电脑换新系统的应用可以这样快速迁移
  2. text-align:justify 使用参考
  3. 深度学习-tensorflow1.x之交叉熵损失函数(softmax_cross_entropy_with_logits)代码实现 Tensorflow1.x 和 Numpy
  4. mysql数据库的函数_详解数据库_MySQL: mysql函数
  5. 参数估计(一)--置信区间
  6. JAVA转为wasm
  7. L298N——真正的玄学驱动板
  8. 计算机专业毕业设计题目大全
  9. 计算机断电后自动启动,断电来电后自动开机,神奇的电脑开机方法
  10. NLP实战 文本关键词提取
  11. 寄语十周年:“我与CCF BDCI”大赛十周年寄语火热征集中
  12. 计算机数据表格方框,WPS表格使用心得:不容小觑的小方框 -电脑资料
  13. 反射模式python
  14. DFS和BFS概念及实践+acwing 842 排列数字(dfs) +acwing 844. 走迷宫(bfs)
  15. 微信信息回复 java,微信公众平台开发中使用Java如何实现一个消息回复功能
  16. 能跟你聊DOTA的神经对话模型:MeenaDialoGPT
  17. 如何设置敬业签定时提醒待办事项?
  18. mysql漏洞_应用CVE: 最新的Mysql高危漏洞介绍
  19. php调用c dll,PHP调用DLL的方法
  20. 屏幕背光调节的两种方式

热门文章

  1. sim808模块收发送短信
  2. 怎么用计算机求称呼,亲戚关系称呼神器 三姑六婆计算器
  3. Pushed master to new branch origin/master
  4. 完全解读:用最小二乘法求模型参数
  5. Feedback Prize-Kaggle比赛调研
  6. SAP中物料主数据MRP3中的计划消耗模式及消耗期间的应用逻辑简析
  7. 获得代理ippython_Python爬虫代理IP从哪里获取?
  8. cdn日志文件导入mysql进行分析,核心用到 Python
  9. SystemVerilog中随机的constrain语法
  10. [UWP] ExReaderPlus 英语阅读软件