Command: dir

Manage directories and files.

Usage

Usage: m dir [OPTIONS] [PATH]

Description:  Manage directories and files in the current or specified path.

Options:
  --delete  <empty|dsfiles>  Delete DS_Files files or empty folders recursively in the current path or a specified path.
  --dsfiles <enable|disable> Enable or disable the generation of .DS_Store files.
  --size                     Calculate the size of the current folder or a specified path.
  --tree                     Display a tree view of folders in the current path or a specified path.

Options

--delete <empty|dsfiles> [PATH]

Deletes specific types of items within the current directory or a specified PATH.

  • empty: Finds and deletes all empty subdirectories.
  • dsfiles: Finds and deletes all .DS_Store files.

Examples:

# Delete all empty folders in the current directory
m dir --delete empty

# Delete all .DS_Store files in ~/Downloads
m dir --delete dsfiles ~/Downloads

--dsfiles <enable|disable>

Controls the system-wide setting for creating .DS_Store files on network shares.

Example:

# Disable the creation of .DS_Store files on network volumes
m dir --dsfiles disable

--size [PATH]

Calculates and displays the total size of the current directory or a specified PATH in a human-readable format.

Example:

m dir --size ~/Documents

--tree [PATH]

Displays the contents of the current directory or a specified PATH in a tree-like structure.

Example:

m dir --tree