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.

【初心者必見】zsh環境でaliasを導入する

Last updated at Posted at 2021-03-15

aliasとは

エイリアス 【 alias 】
偽名、別名、通称などの意味を持つ英単語。 ITの分野では、ファイルなどの実体を 別の名前で参照するためのシンボル といった意味で使われることが多い。

git push origin masterなどよく使うコマンドにgpomのような短縮コマンドを登録すること!
タイポが減ってめっちゃ便利機能!

1 google chromeのURL欄に~/を入力

スクリーンショット 2021-03-15 12.28.39.png

ホームディレクトリの一覧から、.zshrcを探し、テキストエディタで開く。(google chromeのディレクトリをテキストエディタにドラックすれば、簡単に.zshrcを編集することができます!)

2.zshrcを編集する

今回はrailsでよく使うコマンドのエイリアスを作成する

# Rails Command
alias rs='rails s'
alias rs4='rails s -p 4000'
alias rc='rails c'
alias cre='rake db:create'
alias mig='rake db:migrate'
alias rol='rake db:rollback'
alias seed='rake db:seed'
alias drop='rake db:drop'
alias rr='rake routes'
alias be='bundle exec'
alias bi='bundle install'

これで、ローカル環境のターミナル上でrsと打てば、rails sが実行される!!

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?