5
大家在 Linux 服务器上会配置那些 alias 提升效率?
source link: https://www.v2ex.com/t/789686
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
先说我的(公司): alias cp="cp -i" alias rm="rm -i" alias mv="mv -i" alias ll="ls -l --color=auto" ...
23 条回复 • 2021-07-15 16:40:25 +08:00
defunct9 3 小时 3 分钟前
dzdh 3 小时 2 分钟前
gp - git push
gl - git pull
gr - git rebase
gs - git stash
gsl - git stash list
gsp - git stash pop
gc - git checkout
gcn - git checkout -b
gn - git branch --show-current
gl - git pull
gr - git rebase
gs - git stash
gsl - git stash list
gsp - git stash pop
gc - git checkout
gcn - git checkout -b
gn - git branch --show-current
zent00 2 小时 53 分钟前
alias ls='ls --show-control-chars -F --color=auto'
alias ll='ls -hl'
alias la='ls -a'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias less='less -R'
alias cat='ccat'
alias diff='colordiff'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -hl'
alias la='ls -a'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias less='less -R'
alias cat='ccat'
alias diff='colordiff'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
princelai 2 小时 37 分钟前
alias cclear="find ~/.cache/ -not -path '~/.cache/vimfiles/*' -type f -atime +10 -size +1M -delete"
pyactive() {
source /opt/venv/$1/bin/activate }
pydeactive() {
active_file=$VIRTUAL_ENV/bin/activate
if [ -e "$active_file" ];
then
deactivate "$active_file"
fi
}
sshtoabc() {
ssh -p 22 [email protected]
}
connectxyz() {
sshpass -p 'password' ssh jdblj
}
最后这个要配合~/.ssh/config
```
Host jdblj
HostName xx.xx.xx.xx
User yourusername
Port 60022
```
pyactive() {
source /opt/venv/$1/bin/activate }
pydeactive() {
active_file=$VIRTUAL_ENV/bin/activate
if [ -e "$active_file" ];
then
deactivate "$active_file"
fi
}
sshtoabc() {
ssh -p 22 [email protected]
}
connectxyz() {
sshpass -p 'password' ssh jdblj
}
最后这个要配合~/.ssh/config
```
Host jdblj
HostName xx.xx.xx.xx
User yourusername
Port 60022
```
AoEiuV020 2 小时 33 分钟前
服务器上的,
alias indent='indent -bap -bli0 -i4 -l99 -ncs -npcs -npsl -fca -lc79 -fc1 -ts4 -cdb -sc'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
桌面的,
alias off='poweroff'
alias offon='reboot'
alias grubnext='grub-reboot --boot-directory=/boot/efi/boot '
alias grubdefault='grub-set-default --boot-directory=/boot/efi/boot '
alias clip='xclip -selection c'
alias cpwd='echo -n $PWD|clip'
alias padoff='synclient touchpadoff=1'
alias padon='synclient touchpadoff=0'
alias leave='date;read -t 7200&&date||systemctl poweroff'
alias es='espeak -vzh'
不过有些后来就没怎么用了,
alias indent='indent -bap -bli0 -i4 -l99 -ncs -npcs -npsl -fca -lc79 -fc1 -ts4 -cdb -sc'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
桌面的,
alias off='poweroff'
alias offon='reboot'
alias grubnext='grub-reboot --boot-directory=/boot/efi/boot '
alias grubdefault='grub-set-default --boot-directory=/boot/efi/boot '
alias clip='xclip -selection c'
alias cpwd='echo -n $PWD|clip'
alias padoff='synclient touchpadoff=1'
alias padon='synclient touchpadoff=0'
alias leave='date;read -t 7200&&date||systemctl poweroff'
alias es='espeak -vzh'
不过有些后来就没怎么用了,
debuggerx 2 小时 14 分钟前
alias py='python3'
alias gitpush="git status && echo -e '\n\033[31m 危险操作,任意键继续\033[0m' && read -n 1 && git commit --amend --no-edit --no-verify && git push -f"
alias aarm='sudo apt-get autoremove --purge'
_apt_get_install()
{
local cur prev words cword
_init_completion || return
special="install"
COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
2> /dev/null ) )
return 0
} &&
_apt_get_remove()
{
local cur prev words cword
_init_completion || return
special="remove"
if [[ -f /etc/debian_version ]]; then
# Debian system
COMPREPLY=( $( \
_xfunc dpkg _comp_dpkg_installed_packages $cur ) )
else
# assume RPM based
_xfunc rpm _rpm_installed_packages
fi
return 0
} &&
complete -F _apt_get_install ainstall
complete -F _apt_get_remove arm
alias ainstall='sudo apt-get install'
alias arm='sudo apt-get --purge remove'
alias gitpush="git status && echo -e '\n\033[31m 危险操作,任意键继续\033[0m' && read -n 1 && git commit --amend --no-edit --no-verify && git push -f"
alias aarm='sudo apt-get autoremove --purge'
_apt_get_install()
{
local cur prev words cword
_init_completion || return
special="install"
COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
2> /dev/null ) )
return 0
} &&
_apt_get_remove()
{
local cur prev words cword
_init_completion || return
special="remove"
if [[ -f /etc/debian_version ]]; then
# Debian system
COMPREPLY=( $( \
_xfunc dpkg _comp_dpkg_installed_packages $cur ) )
else
# assume RPM based
_xfunc rpm _rpm_installed_packages
fi
return 0
} &&
complete -F _apt_get_install ainstall
complete -F _apt_get_remove arm
alias ainstall='sudo apt-get install'
alias arm='sudo apt-get --purge remove'
vincent7245 1 小时 13 分钟前
本地启一个 clash 然后
alias fuck='export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890'
alias fuck='export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890'
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK