1 Minute Tech Tips

Support engineers with one-minute articles.

  • About
  • Profile
Close Button
Menu Button Search Button
Close Button
  1. ホーム
  2. tech
  3. linux

linux

n日前のファイルを削除する

2021年7月12日 2021年7月12日

  • Facebook icon
  • Twitter icon
  • Hatena Bookmark icon
  • Pocket icon
  • Feedly icon
  • Line icon

ファイルのローテーションをするために処理を書くことがある、find コマンドの -mtime オプションを使うが、このようなニーズでないと使わないのでメモ。

 find /home/hoge/backup/* -mtime +7 

7日前のファイルが表示される。

xargs コマンドと合わせて削除をする。

find /home/hoge/backup/* -mtime +7 | xargs rm -f

  • Facebook icon
  • Twitter icon
  • Hatena Bookmark icon
  • Pocket icon
  • Feedly icon
  • Line icon

関連記事

  • 自分のグローバルIPアドレスを確認する

  • VyOSでルーティングを設定する

  • Failed to Connect to MySQL at localhost: 3306 through SSH tunnel

  • Cloud Storageをコマンドで操作する

  • mysqlのユーザー作成や権限付与の際よく使うコマンド

  • Linux/Macで好きな容量のファイルを作成する

  • GitLab Connection to gitlab.com timed out. (connect timeout=5)’))

  • The server time zone value ‘Asia/Tokyo’ is unrecognized or represents more than one time zone.

  • Vimでインデントを整形する

  • SQLで累積和を計算する

2021年7月
月 火 水 木 金 土 日
 1234
567891011
12131415161718
19202122232425
262728293031  
« 6月   8月 »

Profile

Certifications

As a testament to my expertise and commitment to lifelong learning, here are some of the professional certifications I have earned:

最近の投稿

  • テスト実行のトラブルシューティング: Pytest エラー「required field “lineno” missing from alias」を解決する
  • M1 MacでDockerを使ってPowerShellを動作させる
  • SQLの再帰と組織階層の探索:WITH RECURSIVEとUNION ALLを理解する
  • Flaskにおける特定のルートのログ出力の無効化について: AWS EC2/ECS
  • AWS CLIでエスケープなしのJSONを送信する

カテゴリー

  • azure (1)
  • Book review (21)
  • laravel (16)
  • run (1)
  • tech (353)
    • aws (116)
      • AWS Certified Security – Specialty (7)
      • AWS Certified Solutions Architect – Associate (24)
      • AWS Certified Solutions Architect – Professional (28)
    • docker (28)
    • GCP (21)
    • go (15)
    • kusanagi(wordpress) (7)
    • linux (61)
    • Mac (12)
    • mysql (9)
    • python (16)
    • redash (17)
    • SQL (1)
    • terraform (1)
    • Vue.js (5)
    • 機械学習 (7)
  • _ (1)
  • 振り返り (2)
  • 未分類 (2)
  • About
  • Profile
© 2023 1 Minute Tech Tips

Made by Godios. Theme