早就想好了要记录一篇Mac系统使用的文章,但迟迟没有开始,草稿躺在那里都快2个月了(刚看了一下日历发现——从入职那天起我到新公司刚好整整2个月,一切都是那么巧合)。
因为换公司的缘故,现在办公用的是Mac OS(Yosemite)系统,从刚开始的不太习惯,到现在的非常习惯以至于不太习惯Windows系统了。这期间整理了一些Mac系统的使用方法和技巧,在此记录一下,做个总结。
=Start=
=首先=
- 查看系统信息 #左上角苹果标志-关于本机
- 学会锁屏 #系统偏好设置-安全与隐私 && 系统偏好设置-桌面与屏幕保护程序-屏幕保护程序-触发角
- 软件安装 #强烈推荐先安装Homebrew(cask)之后再用它来安装别的软件
- 系统/软件的快捷键 #可自定义
- 系统偏好设置
=常用软件列表=
- Xcode
- Homebrew(cask)
- iTerm-2
- Zsh(oh-my-zsh)
- Alfred
- Chrome
- SublimeText2 / Vim
- PyCharm
- Dash
- Mou
- The Unarchiver
- VLC
- 百度拼音输入法 for Mac
- =
- Java / Python / IPython / Ruby / Nodejs / PHP / Perl / Golang / Git / MySQL / Postgresql / Redis / MongoDB / Memcache
- Tunnelblick
- =
- Xmind
=常用快捷键=
- 「ctrl + space」获取「spotlight」,在其中,搜索所有你想要的东西:应用、文件、单词
- 「alt + space」获取「Alfred」
- 「command + space」输入源切换
- 「command + k」Terminal清屏快捷键(clear没鸟用)
http://www.nooidea.com/2011/01/mac-os-x-keyboard-shortcuts.html
=
系统偏好设置 – 键盘 – 修饰键
=额外的技巧=
Mac Tips
- http://apple.stackexchange.com/questions/400/please-share-your-hidden-os-x-features-or-tips-and-tricks
- http://apple.stackexchange.com/questions/12161/os-x-terminal-must-have-utilities
- http://apple.stackexchange.com/questions/82/which-os-x-applications-do-you-find-indispensable
- http://apple.stackexchange.com/questions/5435/got-any-tips-or-tricks-for-terminal-in-mac-os-x
- http://www.macx.cn/thread-2105258-1-1.html
- http://www.ituring.com.cn/minibook/516
Mac Dev Setup
- https://github.com/herrbischoff/awesome-osx-command-line
- https://github.com/nicolashery/mac-dev-setup
- https://github.com/kennyledet/MacDevelopmentSetupGuidelines
- https://github.com/pubyun/macdev
- http://insights.thoughtworkers.org/ocds-guide-to-setting-up-mac/
Mac Setup/Tips
- http://sourabhbajaj.com/mac-setup/
- http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
- http://macsh
uo.com/ - http://www.c
nblogs.com/c hijianqiang/ archive/2013 /02/23/macin dex.html - http://www.i
turing.com.c n/minibook/5 16 - http://www.c
nblogs.com/c hijianqiang/ archive/2013 /01/04/macte ch.html - http://www.c
nblogs.com/c hijianqiang/ archive/2013 /01/25/macte ch2.html - http://www.c
nblogs.com/c hijianqiang/ archive/2013 /01/25/macte ch3.html
- site:zhihu.com mac 技巧
- http://www.z
hihu.com/top ic/19591970 - http://www.z
hihu.com/que stion/208730 70 - http://www.z
hihu.com/que stion/209853 89 - http://www.z
hihu.com/que stion/241844 76 - http://www.z
hihu.com/que stion/247570 23 - http://www.z
hihu.com/que stion/200218 61 - http://www.z
hihu.com/que stion/195503 27
=EOF=
在Mac上校验文件的哈希值
MD5值:md5 /path/to/file
SHA1值:shasum /path/to/file
在Mac上用Homebrew安装VirtualBox虚拟机
brew search virtualbox
brew info Caskroom/cask/virtualbox
brew info virtualbox
brew cask info virtualbox
brew cask install virtualbox
Safari浏览器经常弹出一个叫MacKeeper的广告,如何清除?
https://www.zhihu.com/question/24850356
Apple FSEvents(文件系统事件)相关的取证问题总结
http://nicoleibrahim.com/apple-fsevents-forensics/
https://developer.apple.com/reference/coreservices/fseventstreameventid
filewatcher – macOS 系统一款监控进程资源访问情况的工具,比如可以监控指定进程的文件访问操作
https://github.com/m3liot/filewatcher
实现 macOS 内核监控的几种方法
https://paper.seebug.org/380/
macOS Sierra: 抹掉并重新安装 macOS
https://support.apple.com/kb/PH25649?locale=zh_CN&viewlocale=zh_CN
macOS Sierra: 重新安装 Mac 附带的应用
https://support.apple.com/kb/PH25608?locale=zh_CN&viewlocale=zh_CN
如何下载 macOS Sierra
https://support.apple.com/zh-cn/HT208202
https://itunes.apple.com/cn/app/macos-sierra/id1127487414?mt=12
重装 Mac 系统 #nice & latest
http://superdanny.link/2017/02/05/Reinstall-the-MacOS/
Mac重装记录
http://blog.devtang.com/2014/04/12/install-mavericks-note/
通过 U 盘启动重装 macOS 系统
http://www.mayanlong.com/archives/2016/315.html
恢复MacBook Pro出厂设置
这个方法会清除掉计算机存储的所有数据。所以备份数据后再进行重置,否则你将遗失所有数据。
重新安装 macOS 不会抹掉您的信息。【重要事项】若要重新安装 macOS,您的电脑必须接入互联网。
重装macOS
http://blog.ykqmain.com/mac/
Mac 系统的安装
https://github.com/pubyun/macdev/blob/master/install.md
MAC抹盘重装记
https://www.binss.me/blog/reinstall-the-system-of-my-mac/
苹果电脑Mac怎么恢复出厂系统
http://www.xitongcheng.com/jiaocheng/xtazjc_article_16403.html
OS X 系统如何重装?
https://www.zhihu.com/question/21454213
简单制作 macOS Sierra 正式版U盘USB启动安装盘方法教程 (全新安装 Mac 系统)
http://www.iplaysoft.com/macos-usb-install-drive.html
macOS用户15个基本Safari技巧汇总
https://www.sysgeek.cn/macos-15-safari-tricks/
1.画中画
2.自定义工具栏
3.搜索标签
4.关闭弹出通知窗口
5.固定标签页
6.静音标签页
7.启用状态栏URL预览
8.自定义个人收藏屏
9.导出为PDF
10.使用AirDrop分享页面
11.使用Handoff更好地进行浏览
12.阅读器视图
13.使用iCloud选项卡
14.快速搜索不同网站
15.使用Ghostery阻止不需要的脚本
Mac平台屏幕按键录制开源软件KeyCastr
http://osp.io/archives/4204
https://github.com/keycastr/keycastr
Mac下更换Homebrew的更新源为国内加速镜像
https://lvtao.net/tool/2117.html
Homebrew的更新源由三部分组成:本体(brew.git)、核心(homebrew-core.git)以及二进制预编译包(homebrew-bottles)
# 替换brew.git:
$ cd "$(brew --repo)"
# 中国科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
# 清华大学:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 替换homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
# 中国科大:
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 清华大学:
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 替换homebrew-bottles:
# 中国科大:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
# 清华大学:
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
# 应用生效:
$ brew update
以上在中国科大和清华大学任选其一即可,在使用其他源的时候,最好先尝试访问其链接看看是否健在,并且因为历史原因,最初的brew.git是叫homebrew.git的,而现在部分更新源早已随官方更名,所以切记要验证。
# 诊断Homebrew的问题:
$ brew doctor
# 重置brew.git设置:
$ cd "$(brew --repo)"
$ git fetch
$ git reset --hard origin/master
# homebrew-core.git同理:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git fetch
$ git reset --hard origin/master
# 应用生效:
$ brew update
重置更新源
# 重置brew.git:
$ cd "$(brew --repo)"
$ git remote set-url origin https://github.com/Homebrew/brew.git
# 重置homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://github.com/Homebrew/homebrew-core.git
Alfred神器使用手册
http://louiszhai.github.io/2018/05/31/alfred/
如何安装alfred
一个例子说明为什么要用alfred
alfred能做什么?
1.应用搜索
2. 文件或目录搜索
3. 文本内容搜索
4. 标记搜索
5. 快捷网页搜索
6. 书签搜索
7. 计算器
8. 词典搜索
9. 通讯录搜索
10. 剪切板搜索
14. 系统常用命令快捷操作
15.直接唤起指定终端并执行命令
小结
alfred workflow
常用的workflow
workflow是什么
如何创建第一个workflow
workflow支持什么功能
哪些语言能编写workflow
workflow的不足
我的一些心得
为什么会有这篇文章
到这,文章就快结束了,从 2015 年 3 月 28 日 接触 alfred 起,我便迷上了它的超强工作流。alfred 几乎可以做任何自动化工作流的事情(只要能用代码描述这个工作流就行),它彻底改变了我对 mac 的认知。此后,我曾多次向团队同学安利并分享它的神奇之处,他们鼓励我开一个在线直播,有偿分享,但对我而言,能写一篇介绍它的文章,几乎是我的荣幸!最后,写得不好的地方欢迎批评斧正,感谢您的阅读!
Mac上如何隐藏顶部的菜单栏? (mac how to hide the top menu bar)
https://www.cnet.com/how-to/how-to-hide-the-menu-bar-in-os-x-el-capitan/
System Preferences > General > Automatically hide and show the menu bar
系统偏好设置 -> 通用 -> 自动隐藏和显示菜单栏
Mac底部的那一行中文名叫「程序坞」 (bottom bar (Dock))
https://www.pntbrother.com/how-to-hide-bottom-bar-dock-macbook-os-x/
系统偏好设置 -> 程序坞 -> 自动显示和隐藏程序坞
如何在Windows, Mac, 和 Linux上禁用USB存储设备?
How to Disable USB Storage Devices on Windows, Mac, and Linux
https://www.makeuseof.com/tag/disable-usb-storage-devices/
# Windows
方法一:手工编辑注册表
Win + R
regedit
Agree to the User Account Control message, then browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR. Here, double-click Start (or right-click > Modify) and edit the value.
To disable, change the value to 4. Should you need to re-enable USB storage at any time, simply change back to 3. Click OK when you’re done.
方法二:创建一个修改注册表的脚本
方法三:使用组策略编辑器
# Mac
第一步:先停掉 SIP 的功能;
第二步:卸载相关驱动 $(kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/)
第三步:将相关驱动删除or重命名 /System/Library/Extensions/IOUSBMassStorageClass.kext
# Linux
将相关USB驱动重命名
Mac上如何停掉USB存储设备的功能?
Block or Disable USB storage devices on Mac
https://www.hawkdive.com/block-or-disable-usb-storage-devices-on/
https://www.makeuseof.com/tag/disable-system-integrity-protection-shouldnt/
https://apple.stackexchange.com/questions/350066/how-to-disable-usb-mass-storage-device-in-macos-mojave
https://github.com/aburgh/Disk-Arbitrator
macOS 如何才能用快捷键锁屏?
https://www.zhihu.com/question/20094264/answer/153670327
方法1:
(仅适用于MacOS High Sierra 10.13或更高版本)
系统自带锁屏快捷键:Ctrl + Command + Q
注意:QQ的快捷键和这个有冲突,需要修改QQ的快捷键。
方法2-使用触发角,更简单快速:
先将「系统偏好设置」-「安全与隐私」-「通用」中,将「进入睡眠或开始屏幕保护程序」的时间设置为「立即」。
然后在「系统偏好设置」 —> 「桌面与屏幕保护程序」 —> 「屏幕保护程序」 —> 「触发角」 -> 选择一个习惯的角用于设置「启动屏幕保护程序」
Mac 电脑锁屏快捷方法
https://blog.mimvp.com/article/17617.html
OS X 快速锁定屏幕,还有这种方法 | 一日一技 · Mac
https://sspai.com/post/33094
Mac 锁屏的各种方法
https://www.yewen.us/blog/2014/06/lock-a-mac/
mac系统修改锁屏快捷键 #未测试成功……
https://blog.csdn.net/junzi528/article/details/78518411
在 iPhone、iPad、iPod touch、Apple TV 或 Mac 上退出登录 iCloud
https://support.apple.com/zh-cn/HT208242
在 Mac 上退出登录
如果您使用的是 macOS High Sierra 或更高版本:
1、前往苹果菜单 >“系统偏好设置”>“iCloud”。
2、点按“退出登录”。
3、如果您想要在退出登录之前在 Mac 上保留 iCloud 数据的副本,请确保选择相应的复选框。然后点按“保留副本”。
4、如果您想要在 Mac 上保留 Safari 浏览器密码的副本,请点按“保留在此 Mac 上”。
出售、赠送或折抵 Mac 前该怎么做
https://support.apple.com/zh-cn/HT201065
1、创建备份
2、退出登录 iTunes
3、退出登录 iCloud
4、退出登录 iMessage 信息
5、如果您要保留已配对的蓝牙设备,请将这些设备取消配对(可选)
6、抹掉硬盘驱动器并重新安装 macOS
如何抹掉 Mac 磁盘
https://support.apple.com/zh-cn/HT208496
MacOS catalina 如何创建/home 目录,显示 mkdir: /home: Read-only file system
https://www.v2ex.com/t/607387
更新到macOS Catalina 10.15后,所有的系统文件分配到一个单独的卷宗,该卷宗文件系统属性为只读
正确解法:
第一步:关闭SIP
首先禁用SIP,Command+R启动到恢复模式,打开终端,运行:
# csrutil disable
# reboot
第二步:
$ csrutil status
System Integrity Protection status: disabled.
$ sudo mount -uw /
$ sudo mkdir -p /home/xxx
注意:重新挂载行为在重启电脑后会失效的,需要重新挂载。
为安全起见,修改完根分区,建议将SIP修改为激活状态。
Read-only file system when attempting mkdir /data/db on Mac
https://stackoverflow.com/questions/58034955/read-only-file-system-when-attempting-mkdir-data-db-on-mac
macOS 无法sudo创建文件夹返回Read-only file system问题解决
https://www.jianshu.com/p/a7e7bbcb913d
Internal Hard Drive Locked “Read Only”
https://discussions.apple.com/thread/4193178
macOS Catalina 10.15 Beta版(19A546d)修改根分区数据
https://www.quwenqing.com/?p=1251
罗技 K380
https://www.logitech.com.cn/zh-cn/product/multi-device-keyboard-k380
罗技k380使用说明
http://h5.china.com.cn/pc/doc_1_1_6825619.html
# 用 K380 键盘切换设备
在您将最多三个设备与键盘连接之后,按下一个“易于切换”按钮即可在这些设备之间切换。
按钮的状态指示灯在稳定亮起前会缓慢闪烁 5 秒,以确认您的选择。 之后键盘便已准备就绪,可以与您的设备配合使用。
# 重新将蓝牙设备与 K380 键盘配对
可以轻松地将设备与 K380 键盘重新配对。 具体操作方式如下:
按住键盘上的“易于切换”按钮之一,直到状态 LED 开始快速闪烁。
在接下来的三分钟,键盘将处于配对模式。