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

提供: オレッジベース
移動先: 案内検索
(まとめ)
 
(同じ利用者による、間の18版が非表示)
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集 ===
==== lsの代用 ====
+
==== 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">
 
<syntaxhighlight lang="bash">
alias ll='ls -lhA --color=auto'
+
alias grep='grep --color=auto'
 +
alias egrep='egrep --color=auto'
 +
alias fgrep='fgrep --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 ..'
 +
</syntaxhighlight>
 +
 +
==== watch関連 ====
 +
<syntaxhighlight lang="bash">
 +
alias watch='watch -c -n 1 '
 
</syntaxhighlight>
 
</syntaxhighlight>
  
28行目: 50行目:
 
黙ってこれをコピペ
 
黙ってこれをコピペ
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
alias ll='ls -lhA --color=auto'
+
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 ..='cd ..'
 +
alias watch='watch -c -n 1 '
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
 
[[Category:よく使う]]
 
[[Category:よく使う]]

2020年10月17日 (土) 00: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 '