linux常见故障处理
- 一. 文件和目录类
- 1.1 File exist 文件已经存在
- 1.2 No such file or directory 没有这个文件或目录(这个东西不存在)
- 1.3 command not found 命令找不到(没有这个命令)
- 1.4 invalid option 无效的参数(不可用的参数)
- 1.5 overwrite 覆盖
- 1.6 remove regular empty file 是否删除普通文件(空的)
- 1.7 is a directory xxx是一个目录
- 1.8 descend into directory 是否进入目录
- 1.10 Can't open file for writing 无法打开这个文件
- 1.11 No write since last change
- 1.12 xx column window is too narrow 窗口只有xx列太窄了 无法完全显示
- 二. 网络连接类
- 三. 修改系统基础配置类
一. 文件和目录类
1.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
无法 创建 目录 因为这个目录已经存在
1.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、目录不存在 先创建目录在创建文件/
1.3 command not found 命令找不到(没有这个命令)
[root@oldboyedu59 ~]# mkdiy
-bash: mkdiy: command not found
1.书写错误
2.没有安装
1.4 invalid option 无效的参数(不可用的参数)
[root@oldboyedu59 ~]# touch -p /oldboy/oldboy.txt
touch: invalid option -- 'p'
Try 'touch --help' for more information.
1.5 overwrite 覆盖
cp复制如果已经存在这个文件会提示是否覆盖
[root@oldboyedu59 ~]# cp /oldboy/oldboy.txt /tmp/
cp: overwrite ‘/tmp/oldboy.txt’?
1.6 remove regular empty file 是否删除普通文件(空的)
[root@oldboyedu59 ~]# rm /oldboy/oldboy.txt
rm: remove regular empty file ‘/oldboy/oldboy.txt’?
1.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
1.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: remove regular empty file ‘/data/oldboy09.txt’? n
rm: remove regular empty file ‘/data/oldboy10.txt’? n
rm: remove directory ‘/data/’? n
1.9 Invalid level 无效的层数,层数必须大于0
注意参数位置
[root@oldboyedu59 ~]# tree -L -F 2 /
tree: Invalid level, must be greater than 0.
1.10 Can't open file for writing 无法打开这个文件
vi中 如果目录不存在就会提示
"/oldbyo/oldboy.txt"
"/oldbyo/oldboy.txt" E212: Can't open file for writing
Press ENTER or type command to continue
1.11 No write since last change
E37: No write since last change (add ! to override)
粘包赖(你修改了内容就无法使用:q退出 需要使用:q!
1.12 xx column window is too narrow 窗口只有xx列太窄了 无法完全显示
这是w的坑 空间太小施展不开.
[root@oldboyedu60-lnb ~]# w
w: 39 column window is too narrow
二. 网络连接类
2.1 远程连接错误 Connection Failed 连接失败
使用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.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.2 yum安装软件故障提示 Could not resolve host无法解析主机
Could not resolve host无法解析主机
主要是系统能否上网和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.
2.3 yum安装软件提示:Nothing to do (没事做)
有两种情况:
情况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:软件名字写错或没有配置yum源导致找不到这个软件包
[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
2.4 Name or service not known 域名无法识别(无法上网)
原因:
1:DNS配置错误原因
2:Linux无法上网原因
[root@oldboyedu59 ~]# ping baidu.com
ping: baidu.com: Name or service not known
域名无法识别(无法将域名---->ip地址)
三. 修改系统基础配置类
3.1 重启网卡报错 device not present
[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.
查看详细错误原因
·journalctl -xe·
Apr 01 15:31:05 oldboyusd.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 oldboyusd.1 /etc/sysconfig/network-scripts/ifup-eth[8019]: Device does not seem to be present, delaying initializatio
3.2 修改主机名过程中,命令行中主机名没有变化
1 hostname命令修改主机名(临时 重启服务器之后失效)
[root@oldboyedu59 ~]# hostname
oldboyedu59
[root@oldboyedu59 ~]# hostname oldboyedu59-lnb
2 修改文件内容(写合同 永久 重启服务器之后生效)
vim /etc/hostname
oldboyedu59-lnb
3 检查
[root@oldboyedu59 ~]# hostname
oldboyedu59-lnb
[root@oldboyedu59 ~]# cat /etc/hostname
oldboyedu59-lnb
命令行中的主机名部分没有改变?
解决:重新登录下即可(断开连接,重新连接)
[root@oldboyedu59-lnb ~]#
linux常见故障处理的更多相关文章
- 2 . Linux常见命令
Linux常见命令格式: 命令名称 选项 参数 ls -alh 文件/目录 --all #ls 显示当前目录内容 #ls -l 显示文件详细信息 #ls -hl h已常见单位显示文件大小 k M G# ...
- Linux常见疑难问答
Linux常见疑难问答 (1)按a~z顺序排列启动服务进程. #exportLC_ALL=C #英文环境变量设置,主要用于解决乱码问题 #chkconfig –list | gre ...
- Linux 常见的trouble shooting故障排错
Linux 常见的trouble shooting故障排错 备份开机所必须运行的程序对一个运维人员来说是非常有必要的.在实际生产环境中,系统和数据基本都是安装在不同的硬盘上面,因为企业最关心的还是数据 ...
- 嵌入式Linux开发教程:Linux常见命令(上篇)
摘要:这是对周立功编著的<嵌入式Linux开发教程>的第7期连载.本期刊载内容有关LinuxLinux常见命令中的导航命令.目录命令和文件命令.下一期将连载网络操作命令.安装卸载文件系统等 ...
- 一个linux常见命令的列表
这是一个linux常见命令的列表. 那些有• 标记的条目,你可以直接拷贝到终端上而不需要任何修改,因此你最好开一个终端边读边剪切&拷贝. 所有的命令已在Fedora和Ubuntu下做了测试 命 ...
- Linux系统故障处理案例(一)【转】
2016-08-05 14:41 运行环境:CentOS6.7 故障原因: 昨天在线执行命令yum -y update 在命令执行途中,强制中断并直接运行poweroff命令关机.再次开机出现如图所示 ...
- Linux常见系统故障
Linux常见系统故障 1.修复MBR扇区故障 2.修复GRUB引导故障 3./etc/inittab文件丢失 4.遗忘root用户密码 5.修复文件系统 6.磁盘资源耗尽故障 一.修复MBR扇区故障 ...
- Linux常见操作
前面的话 本文将详细介绍Linux常见操作 基本概念 Linux严格区分大小写,所有内容以文件形式保存,包括硬件 Linux没有扩展名的概念,不靠扩展名来区分文件类型.但有一些约定俗成的扩展名 压缩包 ...
- Linux常见英文报错中文翻译(菜鸟必知)
Linux常见英文报错中文翻译(菜鸟必知) 1.command not found 命令没有找到 2.No such file or directory 没有这个文件或目录 3.Permission ...
随机推荐
- [转帖]5G网速那么快,基站辐射会很大吗?
5G网速那么快,基站辐射会很大吗? 鲜枣课堂 2019-04-20 21:19收藏55评论6社交通讯 题图来自东方IC,本文来自微信公众号:鲜枣课堂(ID:xzclasscom),作者:小枣君 ...
- git常用命令二、:git stash
Git stash 储藏工作现场(当你不得不新建分支,或者切换分支,但是当前工作区的修改并不想提交) git stash Saved working directory and index state ...
- StringBuilder的常用方法
转自:https://www.cnblogs.com/jack-Leo/p/6684447.html 在程序开发过程中,我们常常碰到字符串连接的情况,方便和直接的方式是通过"+"符 ...
- jmeter压测数据库,抓包工具,python基础
jmeter压力测试 前提场景的设置:单场景(单个接口进行压力测试一个请求)或混合场景(有业务流程的场景进行压力测试多个请求),压测时间一般在5--1515分组具体看需求. 数据准备:数据量少和数据量 ...
- YApi二次开发环境部署
YApi 是去哪儿网大前端技术中心开源的一个可视化的接口管理平台.下面是在CentOS7下搭建二次开发环境步骤. 1 安装MongoDB 具体安装参考CentOS7安装MongoDB 2 安装Node ...
- react native 封装TextInput组件
上一篇 react-native文章提到了TextInput组件对安卓的适配问题,因此对该组件进行封装很有必要. 文章地址 react native定报预披项目知识点总结 TextInput介绍 官 ...
- Re.多项式求逆
前言 emmm暂无 多项式求逆目的 顾名思义 就是求出一个多项式的摸xn时的逆 给定一个多项式F(x),请求出一个多项式G(x),满足F(x)∗G(x)≡1(modxn),系数对998244353取模 ...
- 02--STL序列容器(Vector)
一:vector容器简介 图片和顺序栈相似,但是vector数组是动态数组,支持随机存取--->但是在尾部添加或者溢出元素非常快速,中间插入删除费时 vector是将元素置于一个动态数组中加以管 ...
- Jenkins-在windows上配置自动化部署(Jenkins+Gitblit)
Jenkins-在windows上配置自动化部署(Jenkins+Gitblit) 1. 安装好 Jenkins(注:安装目录需没有空格,否则安装gitlab hook 插件时会报错,安装在c盘跟目录 ...
- js制作可拖拽可点击的悬浮球
兼容mouse事件和touch事件,支持IE9及其以上 效果展示:https://jsfiddle.net/shifeng/7xebf3u0/ // index.html <!DOCTYPE h ...