LoginSignup
0
0

More than 1 year has passed since last update.

#Linux の touch でファイル作成をする時にディレクトリが存在しなくてもエラーを起こさない mkdir -p みたいなエイリアスを作る

Last updated at Posted at 2019-12-03

settiing

以下をコンソールで直接実行

あるいは

~/.zshrc ~/.bashrc などにエイリアスを登録して関数を作る

function touchp() { mkdir -p $(dirname "$1"); touch "$1"; }

execute

touchp ~/too/deep/dir/dir/dir/file.txt

Ref

mkdir + touch を実現するコマンドinstall - Qiita

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

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