> For the complete documentation index, see [llms.txt](https://pshizhsysu.gitbook.io/shell/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pshizhsysu.gitbook.io/shell/shellbian-cheng-chang-yong-ming-ling.md).

# shell-编程常用命令

```
hostnamectl set-name ${HOSTNAME,,}    # 主机名大写to小写
sed -i "s#search#replace#g" file    # 替换file中字符串
date '+%Y-%m-%d %H:%M:%S'        # 以"yyyy-mm-dd HH:MM:SS"格式输出
```
