「よく使うalias」の版間の差分

提供: オレッジベース
ナビゲーションに移動 検索に移動
編集の要約なし
編集の要約なし
10行目: 10行目:


=== alias集 ===
=== alias集 ===
==== lsの代用 ====
==== ls関連 ====
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
alias ll='ls -lhA --color=auto'
alias ll='ls -lhA --color=auto'
</syntaxhighlight>
</syntaxhighlight>


==== gitのlog ====
==== git関連 ====
<syntaxhighlight lang="bash">
<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"'
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>
</syntaxhighlight>


==== 親ディレクトリへの移動 ====
==== cd関連 ====
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
alias ..='cd ..'
alias ..='cd ..'
alias -='cd -'
</syntaxhighlight>
</syntaxhighlight>


31行目: 32行目:
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 ..='cd ..'
alias -='cd -'
</syntaxhighlight>
</syntaxhighlight>




[[Category:よく使う]]
[[Category:よく使う]]

2019年3月7日 (木) 05:34時点における版

aliasを記載する場所

~/.bash_profile


aliasを即反映

$ source ~/.bash_profile


alias集

ls関連

alias ll='ls -lhA --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 ..'
alias -='cd -'

まとめ

黙ってこれをコピペ

alias ll='ls -lhA --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 -='cd -'