Skip to content

yasuke-kuroda-diezon/script__cleanup_local_files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

概要

ローカル環境の特定ディレクトリ(デフォルトは ~/Desktop~/Downloads)内で、git管理されていないファイルやフォルダ(untracked files)を一括削除するスクリプトです。 不要な一時ファイルやダウンロードファイルの整理、クリーンアップに活用できます。

使い方

初回セットアップ

  1. スクリプトを配置します (場所は任意で、どこにおいても動作します)

    cd ~/practice/script
    git clone git@github.com:yasuke-kuroda-diezon/script__cleanup_local_files.git
  2. ~/Desktop~/Downloads に git リポジトリを作成します(初回のみ)

    cd ~/Desktop
    git init
    cd ~/Downloads
    git init
  3. スクリプトに実行権限を付与します

    chmod +x ~/practice/script/script__cleanup_local_files/index.sh

日々の使い方

以下のコマンドで実行できます。

cd ~
./practice/script/script__cleanup_local_files/index.sh
スクリーンショット 2025-10-05 15 20 31

memo

  • 各ディレクトリに .git ディレクトリが必要です。
  • rmコマンドを実行するのは~/Desktop/ディレクトリを誤って削除する事故が怖いので、git cleanコマンドを利用して安全に削除する方針としました。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages