Mac OS

rm 刪除大量檔案時,出現 Argument list too long

xargs 的命令一次會被調用 2000~ 4000 次左右,因此,如果列出的 log 有一萬筆的話,可能就會被分成 3 到 5 次左右來執行,因而避開了 Argument list too long 的錯誤。

find . -name "*.log" | xargs rm

Homebrew 套件管理工具

# 安裝 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 顯示使用說明
man brew
# 更新套件索引
brew update
# 搜尋可安裝的套件
brew search git
# 安裝套件
brew install git
# 升級已安裝的套件
brew upgrade
# 移除套件
brew uninstall git
# 清理暫存檔
brew cleanup

Homebrew Cask 應用程式管理工具

If you get an error of the type Error: Cask 'hex-fiend-beta' definition is invalid: invalid 'depends_on macos' value: ":lion", where hex-fiend-beta can be any cask name, and :lion any macOS release name, run the following command:

Backup Homebrew Setup

wil create Brewfile

Restore

In Brewfile path

修復 Dock 上的 icon 遺失

  • 先從 Applications 內,將該 app 拖移到 Dock

  • 若不行的話,將電腦進入安全模式,會清掉 low-level caches

  • 關機 image

  • 開機時按住 shift,直到開機完成 image

  • 正常重新開機

完整反安裝 Xcode

安裝 Xcode Command Line 開發者套件而不安裝 XCode

刪除 .DS_Store

不要在網路磁碟上自動產生 .DS_Store

.DS_Store 會用來儲存目錄圖示狀態

  1. 編輯 /etc/syslog.conf

    在這個檔案裡加上下面一行:

  2. 重新啟動 syslogd

    執行下面的兩行指令,重新指動 syslod:

  3. 檢查 /var/log/cron.log

    等 cron job 的時間到了之後,應該就能看到 /var/log/cron.log

QuickLook

Folder path:

/Library/QuickLook/ /Users/$(whoami)/Library/QuickLook/

  • QuicklookStephen

    QLStephen is a QuickLook plugin that lets you view plain text files without a file extension. Files like:README, INSTALL, Capfile, CHANGELOG, etc...

  • QLMarkdown

    QuickLook generator for Markdown files.

Beyond compare

zshrc

移除檔案

設定個別的使用者帳號或群組權限

使用 sudo 時改用指纹解鎖

或可使用 sudo-touchid

Last updated