Todos Novo

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Entrar


Todos Novo Entrar

All gists matching topic path

Mais recente criado
Menos recente criado
Mais recente atualizado
Menos recente atualizado

timmy / 永久添加 /usr/local/bin 到 PATH

1 curtidas
0 bifurcações
1 arquivos
Última atividade 10 months ago
這段腳本檢查並永久將 /usr/local/bin 添加到 PATH,如果尚未存在,則更新 .bashrc,並透過 source ~/.bashrc 立即生效。
automation bash environment linux path script shell
1 # 永久添加 /usr/local/bin 到 PATH
2 echo "永久添加 /usr/local/bin 到 PATH..."
3 if ! grep -q "/usr/local/bin" ~/.bashrc; then
4 echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc
5 echo "/usr/local/bin 已添加到 PATH 中。"
6 else
7 echo "/usr/local/bin 已在 PATH 中,無需再次添加。"
8 fi
9
10 # 重新整理環境變數
Próximo Anterior

Desenvolvido por Opengist ⋅ Load: 24ms⋅

Português
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文