Linux Interview questions

@@用户管理

面试题:
开机bios自检,检测硬件的问题
主板
CPU
内存
硬盘
电源
在企业中出问题最多的硬件: 硬件服务器 IDC机房 自建机房
1.磁盘 出了问题怎么办? 磁盘的详细属性
互联网公司: 表现的有经验
1).是否在保质期内 3年
如果保质期3年内,联系售后直接换新的
2).过了保质期,有库存吗 直接采购
问领导: 更换硬盘的流程
3).在质保期内更好流程
a.联系售后
b.联系IDC机房
定时间 身份证

2.内存 内存不会坏
a.兼容性问题 关机重启 或者刚开机无法启动服务器
重新插拔内存,擦拭金手指
全部拔下一根根插 插一根启动一下
一根一根往下拔 拔一根启动一下

3.电源 坏了直接换 服务器支持两块电源
4.主板 坏了换
5.CPU 风扇

面试题: 如果出现了bash版本号如何解决?
第一步: 注释掉/etc/profile中的PS1变量(如果有PS1变量,如果没有,直接第二步)

第二步: 删除隐藏文件重新登录系统
[root@db01 ~]# rm -rf .bash_profile .bash
.bash_history .bash_logout .bash_profile .bashrc
[root@db01 ~]# rm -rf .bash_profile .bashrc
[root@db01 ~]# exit

-bash-4.2#
-bash-4.2#
-bash-4.2#

第三步: 解决方法 复制模版文件到家目录
-bash-4.2# cp /etc/skel/.* .
查看是否复制成功 .bash_profile和.bashrc
-bash-4.2# ll .bash*
-rw------- 1 root root 22021 Mar 20 12:02 .bash_history
-rw-r--r-- 1 root root 18 Mar 20 12:02 .bash_logout
-rw-r--r-- 1 root root 193 Mar 20 12:02 .bash_profile
-rw-r--r-- 1 root root 231 Mar 20 12:02 .bashrc

第四步: 退出重新连接操作系统
exit

第四步: 如果不退出可以让profile直接运行一次
使用. 或者source
-bash-4.2# . .bash_profile
[root@db01 ~]#
[root@db01 ~]#

PS1变量: 临时修改
[root@db01 /etc/sysconfig/network-scripts]#PS1='[\u \t@\h \w]$'
[root 11:56:17@db01 /etc/sysconfig/network-scripts]#
[root 11:56:18@db01 /etc/sysconfig/network-scripts]#
[root 11:56:18@db01 /etc/sysconfig/network-scripts]#
[root 11:56:18@db01 /etc/sysconfig/network-scripts]#
[root 11:56:18@db01 /etc/sysconfig/network-scripts]#
[root 11:56:19@db01 /etc/sysconfig/network-scripts]#
永久修改写入/etc/profile

答: 出现以上问题是由于误删除了家目录下的隐藏文件.bash_profile .bashrc
解决方法 复制/etc/skel/目录下的隐藏文件 到家目录
然后重新连接即可

@@磁盘管理

什么情况系统的inode号会变满 大量小文件
1.定时任务没有开启邮件服务器情况会产生临时小文件
2.服务运行过程中,开发问题产生临时小文件
3.误操作脚本问题

posted @ 2024-03-20 19:46  酿酒的果实  阅读(26)  评论(0)    收藏  举报