Mac系統優化

適用Mac OS X 10.10及以上版本


1.修改打開文件數限制 
sudo新建文件/Library/LaunchDaemons/limit.maxfiles.plist並添加以下內容: 
git

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "
<plist version="1.0">
    <dict>        
        <key>Label</key>
        <string>limit.maxfiles</string>
        <key>ProgramArguments</key>
        <array>
            <string>launchctl</string>
            <string>limit</string>
            <string>maxfiles</string>
            <string>1048576</string>
            <string>1048576</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>ServiceIPC</key>
        <false/>
    </dict>
</plist>


2.修改打開進程數限制 
sudo新建文件/Library/LaunchDaemons/limit.maxproc.plist並添加以下內容:github

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>limit.maxproc</string>
        <key>ProgramArguments</key>
        <array>
            <string>launchctl</string>
            <string>limit</string>
            <string>maxproc</string>
            <string>2048</string>
            <string>2048</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>ServiceIPC</key>
        <false/>
    </dict>
</plist>


3. 添加ls列出詳細信息別名,修改grep高亮顯示 
sudo打開文件/etc/profile並添加以下內容:ruby

alias ll='ls -l'
alias grep='grep --color=auto'


4.添加brew包管理程序並使用國內包鏡像加速 
終端直接運行命令以下:curl

ruby -e "$(curl -fsSL 
brew install git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
brew update


5.添加Oh My Zsh並使用Zsh替換原有Bash 
終端直接運行命令以下:ide

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
相關文章
相關標籤/搜索