命令行快捷键/别名

为了节约时间(偷懒),下面介绍一下mac/Linux下使用alias配置常用命令。

自定义命令

  • Windows下编辑~/.bash_profile

  • Linux下编辑~/.bashrc

直接上我的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Linux
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Artisan
alias autoload='composer dump-autoload';
alias migrate='php artisan migrate';
alias seed='php artisan db:seed';
alias key='php artisan key:generate';
alias jwt='php artisan jwt:secret';

alias art.ext='composer require laravel-admin-ext/helpers'
alias art.import='php artisan admin:import helpers'
alias art.list='php artisan list'

alias php.unit='./vendor/bin/phpunit'

# BGCFUN
alias fun.token="php artisan token:make code0809@163.com qadbk365t"
alias fun.scan="php artisan route:scan"
alias fun.model="php artisan code:models"
alias fun.reliese="composer update reliese/laravel"

# Composer
alias com.conf='composer config -gl'
alias com.ali='composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/'
alias repo.install='composer global require slince/composer-registry-manager'
alias repo.ls='composer repo:ls'
alias repo.use='composer repo:use laravel-china'

# Cowsay
alias cowsay='fortune | cowsay';

# Cmatrix
alias cxl='cmatrix';

# ElasticSearch
alias es.run="bin/elasticsearch.bat"
alias es.test="curl http://127.0.0.1:9200"

# FILE
alias ..='cd ..';
alias ....='cd ../../';

# Hexo
alias hexogd='hexo g && hexo d'

# IP
alias wget.ip='wget -qO- http://ipecho.net/plain | xargs echo'
alias wget.ip2='wget -qO - icanhazip.com'
alias curl.ip='curl ifconfig.co'
alias curl.ip2='curl ifconfig.me'
alias curl.ip3='icanhazip.com'

# GuangZhou Weather
alias gztq='curl -4 http://wttr.in/GuangZhou --header "Accept-Language:zh-CN,zh;q=0.8"';

# Github
alias github='git config --global user.name "SoulMate94" && git config --globaluser.email "code0809@163.com" && ssh-keygen -t rsa -C "code0809@163.com"';

# Git
alias ls='ls --color=auto';
alias ll='ls -lh';
alias ld='ll |grep "^d"';
alias psw='ps -a --windows';

alias gst='git status';
alias gad='git add -A';
alias gcm='git commit -m $1';
alias gcb='git checkout $1';
alias gpushb="git push origin $1";
alias gpushm="git push origim master";
alias gpullb="git pull origin $1";
alias gpullm="git pull origin master";
alias gcb="git checkout $1";
alias gcc="git checkout caoxl";
alias gm="git checkout master";
alias gb="git branch";
alias gba="git branch -a";
alias gmb="git merge $1";
alias gmm="git merger master";
alias gdf="git diff";
alias grv="git remote -v";
alias greset='git reset --hard';
alias gll="git log --graph --abbrev-commit --decorate --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)'";

# LaravelS
alias laravels.start='php artisan laravels start';
alias laravels.stop='php artisan laravels stop';
alias laravels.restart='php artisan laravels restart';
alias laravels.reload='php artisan laravels reload';
alias laravels.publish='php artisan laravels publish';
alias laravels.cmd="php artisan laravels $1";

# Nginx
alias nginx.start='service nginx start';
alias nginx.status='service nginx status';
alias nginx.stop='service nginx stop';
alias nginx.restart='service nginx restart';

# PHP
alias serve='php artisan serve';

# VI/VIM
alias vi='vim';

# Other
alias zi='figlet';
alias see.cpu='cat /proc/cpuinfo';
alias see.linux='cat /etc/redhat-release';
alias see.io='iostat -x /dev/sda1';

# .bashrc (Windows下为`.bash_profile`)
alias sss='source ~/.bash_profile';
alias vbash='vim ~/.bash_profile';

Powered by Hexo and Hexo-theme-hiker

Copyright © 2017 - 2023 Keep It Simple And Stupid All Rights Reserved.

访客数 : | 访问量 :