Git Product home page Git Product logo

clean-my-mac's Introduction

Clean My Mac

Shell script to clean macOS using 2 commands (1 if already installed).

Cleaning the OS can improve system performance. With a sizeable amount of data in the system's cache - a lot of which is likely outdated - speed and performance can be impacted.

Another reason to clean the OS is to ensure privacy. Generally, caches contain private information. Clearing this information reduces the risk of it getting out if the system is compromised in any context.

The clean-my-mac.sh script clears data such as outdated caches and logs from macOS.

Setup / Installation

  1. Clone this repository: git clone https://github.com/adamalston/Clean-My-Mac.git

  2. Run: sh clean-my-mac.sh

Note: Any of the instructions in the script can be disabled by adding a hash mark (#: shell comment syntax) to the beginning of the line that the instruction is on.

How it works

Instruction: rm -rfv /path/to/file > /dev/null 2>&1

  • rm is for remove
  • -rfv is three commands:
    • -r: recursive, remove directories and their contents, folders inside will also be removed
    • -f: force, ignore nonexistent files, never prompt
    • -v: verbose, show what is happening
  • > is for redirect
  • /dev/null is a black hole where any data sent, will be discarded
  • 2 is the file descriptor for Standard Error (stderr)
  • & is the symbol for file descriptor (without it, the following 1 would be considered a filename)
  • 1 is the file descriptor for Standard Output (stdout)

Therefore > /dev/null 2>&1 redirects the output of the program to /dev/null - including both the stderr and stdout

clean-my-mac's People

Contributors

adamalston avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.