Linux常见问题

一、When do you need edit /etc/inittab,/etc/fstab,/etc/hosts/ and /etc/profile?

/etc/inittab:由内核启动的用户级进程

/etc/fstab:负责配置Linux开机时自动挂载的分区

/etc/hosts:负责IP地址与域名快速解析的文件

/etc/profile:Linux环境变量

二、How to set the execution permission on file script.sh?

chmod +x script.sh

三、List some method to monitor the resource usage of the host.(eg:cpu,memory)

ps   pstree  pidof top free uptime ifuser lsof mpstat vmstst pidstat iostat iotop watch sar

参考:https://www.cnblogs.com/defias/p/3426976.html

四、List some file in these dirs(/root,/proc,/etc,/boot,/usr,/sys) and give simple explanation of the usage.

/root :目录树的起始点  /,root

/proc:这个目录本身是一个虚拟文件系统,存放在内存中。例如:系统核心、周边装置、行程信息、网络状态等

/etc:系统主要的配置文件。例:帐号密码文件、各种服务启动文件

/boot:主要放置开机会使用到的文件

/usr: Unix操作系统软件资源。放置的数据属于可分享与不可变动的

/sys:虚拟文件系统。记录与核心相关的信息。例如:目前已加载的核心模块以及与核心侦测到的硬件装置信息

参考:http://cn.linux.vbird.org/linux_basic/0210filepermission_3.php

五、How to load a kernel module(eg:kvm_intel),and check an installed kernel module's detail info?

insmod/rmmod/moprobe/modinfo/lsmod

找出内置模块列表:/lib/modules/.../modules.builtin

/sys/module/...

参考:http://www.xitongzhijia.net/xtjc/20151104/61048.html

六、What the symbols stand for in shell :$!,$#,$?,$*?

$! shell最后运行的后台Process的PID

$#传递给函数或脚本的参数个数

$?上个命令的退出状态或函数的返回值。一般情况下,函数执行成功会返回0,失败返回1

$*传递给脚本或函数的所有参数

参考:https://blog.csdn.net/slovyz/article/details/47400107

七、What's the result of the following commands?

$touch {1 2 3 4 5}a;ls --> {1  2  3   4   5}a

$touch {1,2,3,4,5}a;ls --> 1a 2a 3a 4a 5a

$touch {1.2.3.4.5}a;ls--> {1.2.3.4.5}a







参考:鸟哥私房菜 http://cn.linux.vbird.org/linux_basic/linux_basic.php

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值