【Linux】必备故障及原因50个

一. 文件和目录类

  • File exist 文件已经存在
  • No such file or directory 没有这个文件或目录(这个东西不存在)
  • command not found 命令找不到(没有这个命令)
  • invalid option 无效的参数(不可用的参数)
  • overwrite 覆盖
  • remove regular empty file 是否删除普通文件(空的)?
  • is a directory xxx是一个目录
  • descend into directory 是否进入目录
  • Invalid level 无效的层数,层数必须大于0
  • Can’t open file for writing 无法打开这个文件
  • No write since last change
  • xx column window is too narrow 窗口只有xx列太窄了 无法完全显示
  • xxx not a directory 不是一个目录
  • 查看压缩包的时候报错
  • You have mail in /var/spool/mail/root
  • permission denied
  • Warning: Changing a readonly file
  • ‘readonly’ option is set (add ! to override)
  • cp: omitting directory ‘/oldboy/’
    unexpected end of file 或 Unexpected EOF in archive

二. 网络连接类

  • 远程连接错误 Connection Failed 连接失败
  • yum安装软件故障提示 Could not resolve host无法解析主机
  • yum安装软件提示:Nothing to do (没事做)
  • 没有找到叫treea的软件包
  • Name or service not known 域名无法识别(无法上网)

三. 修改系统基础配置类

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

四. 用户相关错误

  • user ‘oldboy’ already exists
  • no such user
  • Only root can do that.
  • Only root can specify a user name.
  • Creating mailbox file: File exists
  • warning: the home directory already exists.
  • /etc/sudoers: syntax error near line 105 <<<

五.脚本及定时任务

一. 文件和目录类

1. File exist 文件已经存在

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

mkdir: cannot create directory ‘/lidao’: File exists
无法 创建 目录 因为这个目录已经存在

2. No such file or directory 没有这个文件或目录(这个东西不存在)

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

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

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

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

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

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

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

find命令与|xargs ll 错误
|xargs后面不支持别名

[root@kangxu ~]# find /oldboy  -name  "*.txt"  -type f |xargs ll
xargs: ll: No such file or directory

3. command not found 命令找不到(没有这个命令)

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

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

4. invalid option 无效的参数(不可用的参数)

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

5. overwrite 覆盖

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

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

6.remove regular empty file 是否删除普通文件(空的)?

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

7. is a directory xxx是一个目录

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

[root@oldboyedu59 ~]# rm /data/
rm: cannot remove/data/: Is a directory

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

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

8. descend into directory 是否进入目录

[root@oldboyedu59 ~]# rm -r /data/
rm: descend into directory ‘/data/? y
rm: remove regular empty file ‘/data/oldboy01.txt’? n
rm: remove regular empty file ‘/data/oldboy02.txt’? n
rm: remove regular empty file ‘/data/oldboy03.txt’? n
rm: remove regular empty file ‘/data/oldboy04.txt’? n
rm: remove regular empty file ‘/data/oldboy05.txt’? n
rm: remove regular empty file ‘/data/oldboy06.txt’? n
rm: remove regular empty file ‘/data/oldboy07.txt’? n
rm: remove regular empty file ‘/data/oldboy08.txt’? n
rm: remov
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值