LoginSignup
0
0

More than 5 years have passed since last update.

cronでログファイルの出力先を間違えたので一括削除した

Posted at

1.lsしたらログファイルの出力場所が間違ってることに気づいた

2.一応消したいファイル一覧を参照して確認
findコマンドで"*.csv"ファイルのみの一覧を表示
※-maxdepthオプションでサブディレクトリを除外

3.rmでファイル削除
-fオプションで強制削除

$ ls -1
hoge.php
hoge.css
log1.csv
log2.csv
log3.csv
.
.
.
$ find ~/dir -maxdepth 1 -name "*.csv"
~/dir/log1.csv
~/dir/log2.csv
~/dir/log3.csv
.
.
.
$ rm -f *.csv
$ ls -1
hoge.php
hoge.css
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