1. open -e test.txt
    • Opens test.txt in TextEdit on macOS
  2. python3 -m http.server 9000
    • Opens a Python web server on port 9000 in the current directory
  3. find . -type d \( -name .git -o -name node_modules -o -name .jekyll-cache -o -name venv \) -prune -o -print | sed -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
    • Prints directory structure, excluding the .git, .jekyll-cache, venv and node_modules directories, in a tree-like format
  4. docker ps -aq | xargs docker rm -f
    • Kill all Docker containers
  5. lsof -ti :4000 | xargs kill -9
    • Kill a process running on port 4000
    • lsof -ti :4000 finds the process ID (PID) using port 4000
    • xargs kill -9 sends the kill signal to terminate the process
  6. sw_vers
    • Displays the macOS version, including the ProductName, ProductVersion, and BuildVersion. See sw_vers man page.
  7. system_profiler SPHardwareDataType
    • Shows detailed system hardware information including processor, memory, and serial number. See system_profiler man page.
  8. system_profiler
    • Provides a comprehensive overview of all system specifications, including hardware, software, and other components. See system_profiler man page.
  9. history
    • See history of fish shell commands
    • History is stored at ~/.local/share/fish/fish_history
  10. cp -r (ls -1d -- */| tail -1) (today)-daily-journal
    • Copy the last directory in the current directory to the (today)-daily-journal directory
  11. date "+%G-w%V-%u"
  12. cp ~/Downloads/"$(ls -tU ~/Downloads/ | head -1)" .
    • Copy the latest downloaded file from ~/Downloads to the current directory
  13. brew autoremove
    • Removes packages that were installed as dependencies but are no longer needed
  14. brew leaves
    • Lists installed Homebrew packages that are not dependencies of other packages
  15. brew cleanup
    • Removes old versions of installed packages and clears the download cache
    • Use brew cleanup --dry-run to preview what would be removed first
  16. ls -lt
    • Lists files sorted by modification time, newest first
    • Add -r to reverse (oldest first): ls -ltr
  17. ls -ltU
    • Lists files sorted by creation time, newest first (macOS only)