first commit

This commit is contained in:
2025-06-14 20:26:14 +02:00
commit 1edfd60dbd
351 changed files with 34592 additions and 0 deletions

32
.memo/shell.md Normal file
View File

@@ -0,0 +1,32 @@
## 登陆 shell
登陆 shell 是指用户通过终端登录系统时启动的 shell通常是用户登录时执行的第一个 shell可以通过`grep "^$(whoami):" /etc/passwd`查看。
登陆 shell 为 bash 时,在登陆时会检索
- `/etc/profile`
并加载,并会加载以下第一个存在的用户配置文件:
- `~/.bash_profile`
- `~/.bash_login`
- `~/.profile`
所有全局环境变量以及其他非交互配置(如 ssh-agent都可以写进这些文件。
## 非登陆 shell
非登陆 shell 是指用户在已经登录的情况下启动的 shell通常是通过终端仿真器或其他方式打开的 shell。
非登陆 shell 为 bash 时,会先加载`/etc/bash.bashrc`,然后加载用户的`~/.bashrc`文件。
对于非登陆 shell 为 fish 的情况,则会先加载`/etc/fish/conf.d`以及`/etc/fish/config.fish`
然后加载用户的`~/.config/fish/conf.d`以及`~/.config/fish/config.fish`
非登陆 shell 会继承登陆 shell 的环境变量,但不会加载登陆 shell 的配置文件。
## 当前做法
桌面端将登陆 shell 设置为 bash对于终端模拟器显式指定 shell 为 fish并禁用 conf.d 目录下的配置文件。
服务器端同样将登陆 shell 设置为 bash并在.bashrc 中启动 fish同样不使用 conf.d 目录下的配置文件。