LoginSignup
25
14

More than 3 years have passed since last update.

mac ターミナル で llコマンドを 実行 できるようにする

Last updated at Posted at 2019-10-18

目的

  • macでコマンド$ llを実行できるようにする方法を知る。

実施概要

  1. .bashrc修正
  2. .bash_profile修正
  3. 設定の反映

実施詳細

  1. .bashrc修正
    1. 下記コマンドを実行して.bashrcファイルを開く。
  $ cd
  $ vim .bashrc
  1. 下記内容を開いた.bashrcファイルに記載する。
  alias ll='ls -laF'
  1. 保存して閉じる。

    1. .bash_profile修正
  2. 下記コマンドを実行して.bash_profileファイルを開く。

  $ vim .bash_profile
  1. 下記内容を開いた.bash_profileファイルの最終行に記載する。
  source ~/.bashrc
  1. 保存して閉じる。

    1. 設定の反映
  2. 下記コマンドを実行して設定を反映させる。

  $ source .bash_profile

まとめ

  • .bashrcファイルにalias 省略形のコマンド='実際に実行してもらうコマンド'のように記載するとどんなコマンドでも自分の好きなようにショートカット登録することができる。
  • .bashrcファイルに記載しただけだとその内容が反映されないため、source ~/.bashrcを記載した。.bash_profileファイルをコマンド$ source .bash_profileで反映させる必要がある。
25
14
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
25
14