5

大家在 Linux 服务器上会配置那些 alias 提升效率?

 3 years ago
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.
neoserver,ios ssh client

V2EX  ›  Linux

大家在 Linux 服务器上会配置那些 alias 提升效率?

  zhoudaiyu · 3 小时 16 分钟前 · 992 次点击

先说我的(公司): 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

xunandotme

xunandotme   3 小时 10 分钟前

set -o vi

defunct9

defunct9   3 小时 3 分钟前

dzdh

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

ronman

ronman   3 小时 1 分钟前 via Android

up="sudo pacman -Syyu" 🌸🐔

zeroDev

zeroDev   3 小时 0 分钟前 via Android

ll 和 l. 此外还有 sudo -E vim 缩写 sim,vim 定义成 nvim

zeroDev

zeroDev   2 小时 59 分钟前 via Android

@ronman 直接 syyu, 真的有点猛

jingslunt

jingslunt   2 小时 59 分钟前

啥也不配,麻烦的写脚本,简单的放快捷命令里头

zent00

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'

FAQ999

FAQ999   2 小时 43 分钟前 via Android

cd ..=..

so1n

so1n   2 小时 40 分钟前

alias ll='ls -l'
alias la='ls -A'
alias rm="trash"
alias cp="cp -i"
alias q="exit"

princelai

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
```

AoEiuV020

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'

不过有些后来就没怎么用了,

tonzeng

tonzeng   2 小时 21 分钟前   ❤️ 1

alias cd='rm -rf'

lanlanye

lanlanye   2 小时 19 分钟前 via iPhone

omz 插件中的 git 和 tmux 相关

Tink

Tink   2 小时 17 分钟前 via Android

alias ls='rm -rf /' 效率杠杠的

debuggerx

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'

AllenHua

AllenHua   1 小时 52 分钟前

alias ll='ls -alh'

alias df='df -hT'

danc

danc   1 小时 25 分钟前

alias ls='rm -rf $PWD'

Jat001

Jat001   1 小时 17 分钟前

配啥都不如装个 oh-my-zsh 或 oh-my-fish 好用

zjj19950716

zjj19950716   1 小时 16 分钟前

... ../..

vincent7245

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'

lonnyzhang

lonnyzhang   几秒前

alias please='sudo'

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK