0
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.

ディレクトリを作成して作成したディレクトリに移動するコマンドを追加する

Posted at

目的

  • ディレクトリを作成してそのディレクトリに移動するコマンドを登録する方法をまとめる

条件

  • エイリアスファイルが作成されていること。
  • .bash_aliasesファイルの読み込みの記載が.bash_profileなどに記載されていること。

方法

  1. 下記コマンドを実行してエイリアスファイルを開く。

    $ vi ~/.bash_aliases
    
  2. 下記の記載をする。

    ~/.bash_aliases
    function mkcd() {
        mkdir $1;
        cd $1;
    }
    alias mkcd=mkcd
    
  3. 下記コマンドを実行してエイリアスファイルを読み込む

    $ source ~/.bash_aliases
    
0
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
0
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?