1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

作業の高速化 alias編

Last updated at Posted at 2019-11-06

作業を高速化

alias という便利なものを使っていく
自分で設定した名前のコマンドを作成することができる。

使用例

ファイルを作成する時

terminal
$ touch index.html

ってやりますよね?
aliasを使ってコマンドを作成すると

terminal
$ html

とするだけでindex.htmlが作成できます。

どうやるか

ホームディレクトリに .bash_profile ファイルを作成する。(.bashrcでも可)

terminal
$ touch .bash_profile

下のように記述

.bash_profile
 alias html="touch index.html"

sourceコマンドで変更を反映させる

teminal
$ source .bash_profile

これで作成したhtmlコマンドが使用できる
試しにやってみてください。

terminal
$ html

ファイルを確認すると新たに追加されているはずです。

終わり

ls とか間違えて slってしちゃう時ありますよね。

.bash_profile
alias ls="ls -G"
alias sl="ls -G"
alias ld="ls -G"
alias ks="ls -G"
alias kd="ls -G"
alias s="ls -G"
alias l="ls -G"

私はこんなせっかちなことしてます。
他にも npm installを「n」 、git pullとかを「gp」とかにしてます。

PK_FIREとかにすると楽しくなるかも(ならない)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?