LoginSignup
2
0

More than 3 years have passed since last update.

bashで、「ファイルが存在する場合は削除」する。

Posted at
rm exist.txt 2> /dev/null

もし存在しないならこのコードは標準エラー出力になります。
そして標準エラー出力の2を/dev/nullに捨てます。

参考
https://qiita.com/i35_267/items/158cd20ed26f73a3d894

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