Linux系统常用的系统配置
文章目录
本文记录Linux系统常用的系统设置的方法。
1 Linux系统配置coredump的方法
1.1 临时配置方法
- 设置ulimit中core大小限制
执行命令:
ulimit -c unlimited
- 配置coredump的生成路径
执行命令:
echo "/path/core-%e-%p-%s-%t" > /proc/sys/kernel/core_pattern
该配置方法,当系统重启后就会失效。
1.2 永久配置方法
- 配置当前用户的corefile size大小
- 在配置文件中增加一行配置项,如下所示:
|
|
其中,对于item为core的配置项,value的单位为KB.
- 然后再/etc/profile文件中增加配置:
|
|
- 然后再进程的启动脚本中添加如下命令:
|
|
参考文档:
How to enable core file dumps when an application crashes or segmentation faults
2 修改Hostname
2.1 通过命令修改
|
|
2.2 修改配置文件
修改配置文件/etc/hostname中的名字即可(需要root权限)。
3 Linux修改终端的显示
通过修改/etc/profile或者当前用户目录下的PS1变量既可以实现。
参考链接: How to display current path in command prompt in linux’s sh (not bash)?
|
|
4 修改系统时区
|
|
5 date格式化时间
|
|