[root@oldboyedu59 ~]# rm /data/ rm: cannot remove ‘/data/’: Is a directory
vi命令中 使用vi编辑目录也会报错
1 2 3
"/oldboy" E502: "/oldboy" is a directory Press ENTER or typecommand to continue
8. descend into directory 是否进入目录
1 2 3 4 5 6 7 8 9 10 11 12 13
[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: remove regular empty file ‘/data/oldboy09.txt’? n rm: remove regular empty file ‘/data/oldboy10.txt’? n rm: remove directory ‘/data/’? n
9. Invalid level 无效的层数,层数必须大于0
注意参数位置
1 2
[root@oldboyedu59 ~]# tree -L -F 2 / tree: Invalid level, must be greater than 0.
10. Can’t open file for writing 无法打开这个文件
vi中 如果目录不存在就会提示
1 2 3
"/oldbyo/oldboy.txt" "/oldbyo/oldboy.txt" E212: Can't open file forwriting Press ENTER or typecommand to continue
如果你对这个文件没有权限 也会提示
11.No write since last change
1 2
E37: No write since last change (add ! to override) 粘包赖(你修改了内容就无法使用:q退出 需要使用:q!
12. xx column window is too narrow 窗口只有xx列太窄了 无法完全显示
这是w的坑 空间太小施展不开.
1 2
[root@oldboyedu60-lnb ~]# w w: 39 column window is too narrow
13. xxx not a directory 不是一个目录
背景:创建文件的时候多了一个空格
1 2 3 4 5 6 7
[root@ssdz ~]# touch /oldboy /oldboy.txt #此处要创建/oldboy/oldboy.txt 多个个空格 创建了2个文件 /oldboy和/oldboy.txt [root@ssdz ~]# ls -l /oldboy/ #系统认为oldboy是个目录 所以报错 ls: cannot access /oldboy/: Not a directory [root@ssdz ~]# touch /oldboy/oldboy.txt touch: cannot touch ‘/oldboy/oldboy.txt’: Not a directory [root@ssdz ~]# ls -l /oldboy -rw-r--r--. 1 root root 0 Apr 915:23 /oldboy
14.查看压缩包的时候报错
注意是否有特殊中文符号导致的。
1 2 3 4 5
[root@oldboy59 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
gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now
image.png
二. 网络连接类
1. 远程连接错误 Connection Failed 连接失败
使用Xshell远程连接失败提示,检查端口是否开启或正确
1 2 3 4 5 6
[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测试端口是否打开
1 2 3 4 5 6
[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.
端口开启
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[c:\~]$ telnet 10.0.0.20022 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安装软件故障提示 Could not resolve host无法解析主机
Could not resolve host无法解析主机 主要是系统能否上网和DNS问题.
1 2 3
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安装软件提示:Nothing to do (没事做)
有两种情况: 情况1:软件已经安装并且最新如下:
1 2 3 4 5
Package tree-1.6.0-10.el7.x86_64 already installed and latest version tree软件包已经安装并且是最新版本 Package2:vim-enhanced-7.4.160-5.el7.x86_64 already installed and latest version Package1:bash-completion-2.1-6.el7.noarch already installed and latest version Nothing to do
情况2:软件名字写错或没有配置yum源导致找不到这个软件包
1 2 3 4 5 6 7 8 9 10 11 12
[root@oldboyedu60-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
[root@oldboyedu59 ~]# ping baidu.com ping: baidu.com: Name or service not known 域名无法识别(无法将域名---->ip地址)
5. No route to host
No route to host 没有访问主机的路由(此路不通)
1
#原因 : 防火墙/selinux 没有关闭导致,
三. 修改系统基础配置类
1. 重启网卡报错 device not present
1 2 3
[root@oldboyusd ~]# 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.
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: line 78: unexpected EOF while looking for matching `“‘ /etc/profile 第78行 出乎意料的结尾 正在找 ‘“‘ 这个双引号的另一半
四. 用户类错误
1. user ‘oldboy’ already exists
用户已经存在
1 2
[root@oldboyedu59 ~]# useradd oldboy useradd: user 'oldboy' already exists
2. no such user
没有这个用户
1 2
[root@oldboyedu59 ~]# id lidao id: lidao: no such user
3.Only root can do that.
只有root用户可以使用 非交互式设置密码方式
1 2
[oldboy@oldboyedu59 ~]$ echo 123456|passwd --stdin oldboy Only root can do that.
[oldboy@oldboyedu59 ~]$ passwd oldboy passwd:Only root can specify a user name.
5. Creating mailbox file: File exists 和warning: the home directory already exists.
添加用户的时候提示:
Creating mailbox file: File exists 正在创建这个用户的邮箱:邮箱已经存在 warning: the home directory already exists. 这个用户的家目录已经存在
删除用户的时候,默认不删除家目录和邮箱. 再次添加就会提示家目录存在和邮箱存在
1 2 3 4 5 6 7
[root@oldboyedu59 ~]# id stu01 uid=1005(stu01) gid=1006(stu01) groups=1006(stu01) [root@oldboyedu59 ~]# userdel stu01 [root@oldboyedu59 ~]# useradd stu01 useradd: warning: the home directory already exists. Not copying any filefrom skel directory into it. Creating mailbox file: File exists
6.user nginx is currently used by process 7540
用户正在使用中 被pid是7540的进程使用中
五.脚本及定时任务
1. no crontab for root
root用户没有定时任务
1 2
[root@oldboyedu59 ~]# crontab -l no crontab for root
"/tmp/crontab.5UZIdI" 3L, 115C written crontab: installing new crontab "/tmp/crontab.5UZIdI":3: bad hour 3是第3行的意思,错误的小时 小时位置书写错误 errors in crontab file, can't install. Do you want to retry the same edit?
crontab -e #show time by liyy at 20190101 #*/2 * * * * date >>/tmp/time.log
# 00 21-00 * * * date >>/tmp/time.log 00 21-00 * * * date >>/tmp/time.log #00 21-23,00 * * * date >>/tmp/time.log
#backup /etc/ to /tmp by liyy at 20190101 #00 00 * * * sh /server/scripts/bak-etc.sh "/tmp/crontab.SpZAZH" 9L, 238C written crontab: installing new crontab "/tmp/crontab.SpZAZH":5: bad hour errors in crontab file, can't install. Do you want to retry the same edit?