ETC

etc directory of unix Link to heading

早期系统/bin是用来存放程序(可执行二进制文件)的,然后有了/dev用来存放设备文件,和/lib用来存放库文件。/usr目录很早也有了,首先用来存放用户数据,后来也放一些用户级的/bin/libman形式的用户手册也存放在此。

随着系统越来越庞大,一些无法进行归类的文件就放到了/etc目录,后来慢慢的大家将/etc目录用来存放一些系统级的配置文件,现代unix系统上,几乎所有的配置文件都在/etc目录,etcet cetera的缩写。

I assure you that the original contents of /etc were the “et cetera” that didn’t seem to fit elsewhere. Other variants might do their own etymologies differently.

Regards, Dennis

Dennis: Dennis Richie

tips Link to heading

  • 编辑完 /etc/default/grub 后,用grub-mkconfig -o /boot/grub/grub.cfg更新配置。
  • 从大到小显示目录内容 du -s * | sort -nr
  • 创建固定大小文件 dd if=/dev/zero of=100M.test bs=100M count=1
  • Notepad++删除包含关键字的行 .*delete.*
  • 强制复制所有内容 \cp -rf * target/
  • 将unixetc.txt中的AAA替换为BBB sed -i -e 's/AAA/BBB/g' unixetc.txt
  • 将当前目录下所有html文件内的AAA替换为BBB find ./ -name "*.html" -exec grep "AAA" {} \; -exec sed -i 's/AAA/BBB/g' {} \;
  • 删除unixetc.txt中的第3-17行内容 sed -i -e '3,17d' unixetc.txt
  • Ubuntu安装多媒体扩展 sudo apt install ubuntu-restricted-extras
  • Ubuntu卸载snapd sudo apt autoremove --purge snapd
  • GIT配置代理 git config --global http.proxy socks5://127.0.0.1:20170 socks5为代理协议,可配置http/https/socks5等。
  • pip设置国内源 pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  • pip临时使用国内源自升级 python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
  • SCP下载远程文件 scp -P port user@ip:/path/file ./
  • git卡writing objects,可以将远端地址改为ssh方式 git remote set-url origin [email protected]:username/repo.git
  • git备份归档 git archive --format=zip --output=repobak_$(date +%Y-%m-%d).zip master