Python 爬虫项目实战:urllib 请求封装与网页编码异常处理
2026/6/6 17:51:52
.bashrc文件若不想保留之前示例中的配置更改,需将最初备份的.bashrc文件移回原位,并加载该文件以使设置在当前 shell 会话中生效。操作步骤如下:
$ mv ~/.bashrc.bak ~/.bashrc $ source ~/.bashrc当 bash 作为非登录 shell 被调用时,它会加载~/.bashrc、/etc/bashrc和/etc/profile.d/*.sh文件中的配置。
.bash_profile文件详解在非图形化系统中,用户成功登录后会获得一个登录 shell。当 bash 作为登录 shell 被调用时,首先会执行/etc/profile文件,该文件也会运行/etc/profile.d/目录下的脚本,以下代码片段可说明:
for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else这些是应用于任