「よく使うalias」の版間の差分
		
		
		
		ナビゲーションに移動
		検索に移動
		
|  ページの作成:「=== aliasを記載する場所 === ~/.bash_profile   === aliasを即反映 === <syntaxhighlight lang="bash"> $ source ~/.bash_profile </syntaxhighlight>   === alias集 ==...」 | |||
| (同じ利用者による、間の19版が非表示) | |||
| 1行目: | 1行目: | ||
| === aliasを記載する場所 === | === aliasを記載する場所 === | ||
| ~/.bash_profile | ~/.bash_profile<br /> | ||
| or<br /> | |||
| RedHat系<br /> | |||
| /etc/bashrc<br /> | |||
| or<br /> | |||
| Debian / Ubuntu系<br /> | |||
| /etc/bash.bashrc | |||
| === aliasを即反映 === | === aliasを即反映 === | ||
| 10行目: | 15行目: | ||
| === alias集 === | === alias集 === | ||
| ====  | ==== sudo ==== | ||
| <syntaxhighlight lang="bash"> | |||
| alias sudo='sudo ' | |||
| </syntaxhighlight> | |||
| ==== ls関連 ==== | |||
| <syntaxhighlight lang="bash"> | |||
| alias ll='ls -lhA --color=auto --full-time' | |||
| </syntaxhighlight> | |||
| ==== grep関連 ==== | |||
| <syntaxhighlight lang="bash"> | |||
| alias grep='grep --color=auto' | |||
| alias egrep='egrep --color=auto' | |||
| alias fgrep='fgrep --color=auto' | |||
| </syntaxhighlight> | |||
| ==== git関連 ==== | |||
| <syntaxhighlight lang="bash"> | |||
| alias gl='git log --oneline --decorate=full --graph --branches --tags --remotes --date=iso --format="%C(yellow)%H%C(reset) %C(magenta)[%ad]%C(reset) %C(cyan)@%an%C(reset) %C(auto)%d%C(reset) %s"' | |||
| </syntaxhighlight> | |||
| ==== cd関連 ==== | |||
| <syntaxhighlight lang="bash"> | |||
| alias ..='cd ..' | |||
| </syntaxhighlight> | |||
| ==== watch関連 ==== | |||
| <syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| alias  | alias watch='watch -c -n 1 ' | ||
| </syntaxhighlight> | </syntaxhighlight> | ||
| === | === まとめ === | ||
| 黙ってこれをコピペ | |||
| <syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| alias sudo='sudo ' | |||
| alias ll='ls -lhA --color=auto --full-time' | |||
| alias grep='grep --color=auto' | |||
| alias egrep='egrep --color=auto' | |||
| alias fgrep='fgrep --color=auto' | |||
| alias gl='git log --oneline --decorate=full --graph --branches --tags --remotes --date=iso --format="%C(yellow)%H%C(reset) %C(magenta)[%ad]%C(reset) %C(cyan)@%an%C(reset) %C(auto)%d%C(reset) %s"' | alias gl='git log --oneline --decorate=full --graph --branches --tags --remotes --date=iso --format="%C(yellow)%H%C(reset) %C(magenta)[%ad]%C(reset) %C(cyan)@%an%C(reset) %C(auto)%d%C(reset) %s"' | ||
| alias ..='cd ..' | |||
| alias watch='watch -c -n 1 ' | |||
| </syntaxhighlight> | </syntaxhighlight> | ||
| [[Category:よく使う]] | [[Category:よく使う]] | ||
2020年10月16日 (金) 15:33時点における最新版
aliasを記載する場所
~/.bash_profile
or
RedHat系
/etc/bashrc
or
Debian / Ubuntu系
/etc/bash.bashrc
aliasを即反映
$ source ~/.bash_profile
alias集
sudo
alias sudo='sudo '
ls関連
alias ll='ls -lhA --color=auto --full-time'
grep関連
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
git関連
alias gl='git log --oneline --decorate=full --graph --branches --tags --remotes --date=iso --format="%C(yellow)%H%C(reset) %C(magenta)[%ad]%C(reset) %C(cyan)@%an%C(reset) %C(auto)%d%C(reset) %s"'
cd関連
alias ..='cd ..'
watch関連
alias watch='watch -c -n 1 '
まとめ
黙ってこれをコピペ
alias sudo='sudo '
alias ll='ls -lhA --color=auto --full-time'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias gl='git log --oneline --decorate=full --graph --branches --tags --remotes --date=iso --format="%C(yellow)%H%C(reset) %C(magenta)[%ad]%C(reset) %C(cyan)@%an%C(reset) %C(auto)%d%C(reset) %s"'
alias ..='cd ..'
alias watch='watch -c -n 1 '