LoginSignup
4
4

More than 5 years have passed since last update.

コマンド一発でファイルを削除して上書きする方法

Last updated at Posted at 2015-06-08

zshだと簡単で>!でファイルを上書きすることができます。

通常は、以下のコマンドでは出力先がある場合、上書きすることができません。

  $ touch test.txt

  $ echo hello > test.txt

しかし、zshだと以下のように上書きできます。

  $ touch test.txt

  $ echo hello >! test.txt

  $ cat test.txt
  hello
4
4
2

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
4
4