{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/macos-dev-usage-tips/",
  "atlas": "https://www.pystone.net/?node=macos-dev-usage-tips#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/macos-dev-usage-tips.md",
  "context": "https://www.pystone.net/notes/macos-dev-usage-tips.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:macos-dev-usage-tips",
  "slug": "macos-dev-usage-tips",
  "title": "【OS Unix-like】MacOS开发与使用技巧",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "【OS Unix like】MacOS开发与使用技巧",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "22e24a75ad1851957cb6c4cbad6b659b64e0bb6fc0cdd48b5077c09f58197c96",
  "assets": [
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-003-37a38e2032bc.png",
      "url": "/media/020141bcca2b7a53fa83.png",
      "mediaType": "image/png",
      "contentHash": "020141bcca2b7a53fa8355c69136643e5fa03caf45c0b5fc18ff7d46882bfe72",
      "byteLength": 44044,
      "width": 738,
      "height": 505
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-001-43949a7463a9.png",
      "url": "/media/faf9b5f14dca57ccc474.png",
      "mediaType": "image/png",
      "contentHash": "faf9b5f14dca57ccc47475c3f8b69dad911879e1f84222e4c388a186b01ecea9",
      "byteLength": 1630831,
      "width": 500,
      "height": 2835
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-004-21f5009b8c5f.png",
      "url": "/media/574c131bc82289849f8f.png",
      "mediaType": "image/png",
      "contentHash": "574c131bc82289849f8fd7aa42f04240a3e1ec818a506784af34c3e4b60eb6e1",
      "byteLength": 30712,
      "width": 1235,
      "height": 541
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-005-6ac95e32f7f7.png",
      "url": "/media/fbc916e23180ee9027b7.png",
      "mediaType": "image/png",
      "contentHash": "fbc916e23180ee9027b7047f88ae9a8b2d162f9a11c1929e2b98b09b8ca2e8c4",
      "byteLength": 280002,
      "width": 720,
      "height": 422
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-006-424fff913012.jpg",
      "url": "/media/691d87ea893ac0f9ed60.jpg",
      "mediaType": "image/jpeg",
      "contentHash": "691d87ea893ac0f9ed60beddb34d0cb88ea8cffd5e797db0db3596548d58fa42",
      "byteLength": 6989,
      "width": 720,
      "height": 135
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-007-01d4955ec13c.jpg",
      "url": "/media/a0800824108d2fb4a45c.jpg",
      "mediaType": "image/jpeg",
      "contentHash": "a0800824108d2fb4a45c7ef11b4295774ac98c0a603c663bb53f1d8087c9ba77",
      "byteLength": 5433,
      "width": 720,
      "height": 131
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-008-ea81b629357a.jpg",
      "url": "/media/23e455e8cbb5760d5995.jpg",
      "mediaType": "image/jpeg",
      "contentHash": "23e455e8cbb5760d599526cc73ee570d9be6fe71cf013b9783431e84bdeaf0b9",
      "byteLength": 31668,
      "width": 720,
      "height": 571
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-009-417cd778ab7f.jpg",
      "url": "/media/00b2144379806d594b5a.jpg",
      "mediaType": "image/jpeg",
      "contentHash": "00b2144379806d594b5ad478a0628303dcf22280060c929e977f0048de840844",
      "byteLength": 31530,
      "width": 720,
      "height": 464
    },
    {
      "reference": "assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-002-ab9b71d9d1e0.png",
      "url": "/media/f922a9cabed1dde0a3b4.png",
      "mediaType": "image/png",
      "contentHash": "f922a9cabed1dde0a3b4413929c27bdde6365347f27537ed8e0461e2f163fd2a",
      "byteLength": 136404,
      "width": 637,
      "height": 297
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "【OS Unix-like】MacOS开发与使用技巧",
      "anchor": "os-unix-likemacos开发与使用技巧",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#os-unix-likemacos%E5%BC%80%E5%8F%91%E4%B8%8E%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7"
    },
    {
      "depth": 2,
      "text": "快捷键",
      "anchor": "快捷键",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%BF%AB%E6%8D%B7%E9%94%AE"
    },
    {
      "depth": 3,
      "text": "System",
      "anchor": "system",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#system"
    },
    {
      "depth": 3,
      "text": "通用 General",
      "anchor": "通用-general",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E9%80%9A%E7%94%A8-general"
    },
    {
      "depth": 3,
      "text": "截屏",
      "anchor": "截屏",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E6%88%AA%E5%B1%8F"
    },
    {
      "depth": 3,
      "text": "Finder",
      "anchor": "finder",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#finder"
    },
    {
      "depth": 3,
      "text": "浏览器Safari",
      "anchor": "浏览器safari",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E6%B5%8F%E8%A7%88%E5%99%A8safari"
    },
    {
      "depth": 2,
      "text": "Shell命令",
      "anchor": "shell命令",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#shell%E5%91%BD%E4%BB%A4"
    },
    {
      "depth": 2,
      "text": "美化",
      "anchor": "美化",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E7%BE%8E%E5%8C%96"
    },
    {
      "depth": 2,
      "text": "开发环境配置",
      "anchor": "开发环境配置",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE"
    },
    {
      "depth": 3,
      "text": "brew 配置",
      "anchor": "brew-配置",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#brew-%E9%85%8D%E7%BD%AE"
    },
    {
      "depth": 3,
      "text": "Java环境",
      "anchor": "java环境",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#java%E7%8E%AF%E5%A2%83"
    },
    {
      "depth": 3,
      "text": "Python环境",
      "anchor": "python环境",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#python%E7%8E%AF%E5%A2%83"
    },
    {
      "depth": 4,
      "text": "使用brew",
      "anchor": "使用brew",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E4%BD%BF%E7%94%A8brew"
    },
    {
      "depth": 5,
      "text": "pip的使用",
      "anchor": "pip的使用",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#pip%E7%9A%84%E4%BD%BF%E7%94%A8"
    },
    {
      "depth": 4,
      "text": "pyenv的使用",
      "anchor": "pyenv的使用",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#pyenv%E7%9A%84%E4%BD%BF%E7%94%A8"
    },
    {
      "depth": 2,
      "text": "实用工具",
      "anchor": "实用工具",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%AE%9E%E7%94%A8%E5%B7%A5%E5%85%B7"
    },
    {
      "depth": 3,
      "text": "效率之王Afred",
      "anchor": "效率之王afred",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E6%95%88%E7%8E%87%E4%B9%8B%E7%8E%8Bafred"
    },
    {
      "depth": 3,
      "text": "编辑器",
      "anchor": "编辑器",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E7%BC%96%E8%BE%91%E5%99%A8"
    },
    {
      "depth": 3,
      "text": "brew软件管理",
      "anchor": "brew软件管理",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#brew%E8%BD%AF%E4%BB%B6%E7%AE%A1%E7%90%86"
    },
    {
      "depth": 3,
      "text": "开发工具",
      "anchor": "开发工具",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7"
    },
    {
      "depth": 3,
      "text": "自动化工具",
      "anchor": "自动化工具",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E8%87%AA%E5%8A%A8%E5%8C%96%E5%B7%A5%E5%85%B7"
    },
    {
      "depth": 3,
      "text": "其他工具",
      "anchor": "其他工具",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%85%B6%E4%BB%96%E5%B7%A5%E5%85%B7"
    },
    {
      "depth": 2,
      "text": "app",
      "anchor": "app",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#app"
    },
    {
      "depth": 2,
      "text": "常用设置",
      "anchor": "常用设置",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%B8%B8%E7%94%A8%E8%AE%BE%E7%BD%AE"
    },
    {
      "depth": 2,
      "text": "网络相关",
      "anchor": "网络相关",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E7%BD%91%E7%BB%9C%E7%9B%B8%E5%85%B3"
    },
    {
      "depth": 3,
      "text": "常用命令",
      "anchor": "常用命令",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4"
    },
    {
      "depth": 4,
      "text": "ping",
      "anchor": "ping",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#ping"
    },
    {
      "depth": 3,
      "text": "共享",
      "anchor": "共享",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E5%85%B1%E4%BA%AB"
    },
    {
      "depth": 3,
      "text": "远程访问",
      "anchor": "远程访问",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#%E8%BF%9C%E7%A8%8B%E8%AE%BF%E9%97%AE"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/macos-dev-usage-tips/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:software-engineering-and-quality",
      "title": "软件工程与质量保障",
      "url": "https://www.pystone.net/notes/software-engineering-and-quality/",
      "atlas": "https://www.pystone.net/?node=software-engineering-and-quality#knowledge-atlas",
      "label": "软件工程与质量保障",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "CI-CD与质量保障/CI-CD工具链中的“【OS Unix-like】MacOS开发与使用技巧”导航项",
      "citation": "https://www.pystone.net/notes/software-engineering-and-quality/#ci-cd%E4%B8%8E%E8%B4%A8%E9%87%8F%E4%BF%9D%E9%9A%9Cci-cd%E5%B7%A5%E5%85%B7%E9%93%BE"
    }
  ],
  "contentMarkdown": "# 【OS Unix-like】MacOS开发与使用技巧\n\n﻿# 【OS Unix-like】MacOS开发与使用技巧\n\n> 创建时间：2021/7/5 0:06\n\n* 快捷键\n    * System\n    * 通用 General\n    * 截屏\n    * Finder\n    * 浏览器Safari\n  * Shell命令\n  * 美化\n  * 开发环境配置\n    * brew 配置\n    * Java环境\n    * Python环境\n      * 使用brew\n        * pip的使用\n      * pyenv的使用\n  * 实用工具\n    * 效率之王Afred\n    * 编辑器\n    * brew软件管理\n    * 开发工具\n    * 自动化工具\n    * 其他工具\n  * app\n  * 常用设置\n  * 网络相关\n    * 常用命令\n      * ping\n    * 共享\n    * 远程访问\n  * Ref\n\n## 快捷键\n\n设置方法：系统偏好->键盘->快捷键\n\ncmd + space 聚焦搜索\ncmd + space + ter 快速打开终端\ncmd + tab 切换应用程序\ncmd + ～ 切换应用程序内窗口\n\nShift-Command-5 屏幕截图与录制\n四指向上滑动：Mission Control 多屏幕调度\n点按并按住窗口左上角的全屏按钮：Split View分屏\n\nShift + Command + . 显示全部隐藏文件\n\ncmd + up/down 上/下一层文件夹\nenter 改名\n\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-003-37a38e2032bc.png)\n\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-001-43949a7463a9.png)\n\n### System\n\ncmd + option + esc 强制退出程序\ncmd + space 切换输入法\n\n### 通用 General\n\ncmd + H Hide the window\ncmd + M Minimize the window\ncmd + O Open files\ncmd + s Save\ncms + shift + s Save as\ncmd + W Close\ncmd + Q Quit\n\nReturn 重命名\n\n### 截屏\n\ncmd + shift + 3 截取整个屏幕\ncmd + shift + 4 截取选择区域\ncmd + shift + 4 + space 截取选择窗口\n\n### Finder\n\ncmd + sft + . 显示隐藏文件\noption + cmd + i 查看多个文件或文件夹大小\n右键目标文件 + option 复制目标文件的路径\ncmd + [ / ] 前进或后退\ncmd + up / down 进入上级目录 / 下级目录\noption + up / down 定位到多文件列表顶部/底部\nshift + cmd + g 路径进入文件夹\ncmd + f 查询\ncmd + N 新建文件夹\ncmd + Delete 删除\ncmd + shift + delete 清空回收站\n\ncmd + c 复制\ncmd + v 粘贴\ncmd + option + v 粘贴后删除源文件（等效于Windows的ctrl + x, ctrl + v）\n\n### 浏览器Safari\n\ncmd + +/- 放大/缩小\ncmd + T 新建选项卡\ncmd + N 新建窗口\ncmd + R 刷新\nxmd + F 搜索\ncmd + W关闭选项卡\n\n## Shell命令\n\nhttps://explainshell.com/\n\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-004-21f5009b8c5f.png)\n\n显示隐藏\n\n```csharp\nstring str1 = String.Empty;\nstring str2 = String.Empty;\n\nstr2 = String.Intern(sb.ToString());\n\nif((object)str1==(object)str2)\n    Console.WriteLine(&quot;The strings are equal.&quot;);\nelse\n    Console.WriteLine(&quot;The strings are not equal.&quot;);\n\n```\n\n## 美化\n\n壁纸：\nDesktoppr\n\n## 开发环境配置\n\n### brew 配置\n\n```csharp\nstring str1 = String.Empty;\nstring str2 = String.Empty;\n\nstr2 = String.Intern(sb.ToString());\n\nif((object)str1==(object)str2)\n    Console.WriteLine(&quot;The strings are equal.&quot;);\nelse\n    Console.WriteLine(&quot;The strings are not equal.&quot;);\n\n```\n\n### Java环境\n\nhttps://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html#A1096875\n\n### Python环境\n\nMac上有自带的Python环境，其可执行程序在 `/usr/bin` 中，安装在 `/System/Library/Frameworks/Python.framework` 中。不要卸载、改变自带的Python环境，因为操作系统以及一些其他程序是依赖 `/usr/bin`中的python的。\n\n#### 使用brew\n\nhttps://www.cjavapy.com/article/928/\n使用brew安装的python位置在 `/usr/local/Frameworks/Python.framework` 当中，二进制程序在 `/usr/local/bin` 目录下。\n\n在`~/.bashrc` 中设置符号链接\n\n```csharp\nstring str1 = String.Empty;\nstring str2 = String.Empty;\n\nstr2 = String.Intern(sb.ToString());\n\nif((object)str1==(object)str2)\n    Console.WriteLine(&quot;The strings are equal.&quot;);\nelse\n    Console.WriteLine(&quot;The strings are not equal.&quot;);\n\n```\n\n##### pip的使用\n\npip实质上是一个python脚本，命令行运行pip，实际上是使用相应的python版本执行pip脚本。在pip脚本中规定好使用的python版本，即可为特定的 python版本安装模块。\n\n```csharp\nstring str1 = String.Empty;\nstring str2 = String.Empty;\n\nstr2 = String.Intern(sb.ToString());\n\nif((object)str1==(object)str2)\n    Console.WriteLine(&quot;The strings are equal.&quot;);\nelse\n    Console.WriteLine(&quot;The strings are not equal.&quot;);\n\n```\n\n使用时，链接到对应的pip文件，或者将pip文件的python版本修改即可。\n\n#### pyenv的使用\n\nhttps://opensource.com/article/19/5/python-3-default-mac\nhttps://opensource.com/article/19/6/python-virtual-environments-mac\nhttps://www.sqlsec.com/2019/12/pyenv.html\n\n## 实用工具\n\niTerm2 + zsh + oh-my-zsh\nhttps://iterm2.com/features.html\nhttps://ohmyz.sh/\nhttps://github.com/ohmyzsh/ohmyzsh\nhttps://github.com/wting/autojump\n\n### 效率之王Afred\n\nAfred https://www.alfredapp.com/\nhttps://github.com/zenorocha/alfred-workflows\nhttps://www.zhihu.com/question/20656680\n\noption+space\n\n查找workflow：\nwf XXX\n\n  * 打开应用程序\n\n简单查找文件：空格+FileName， 回车：打开，cmd+回车：打开所在位置\n复杂操作文件：find是定位文件，open是定位并打开文件，in是在文件中进行全文检索\n\n输入>即可直接运行shell命令。比如>cat *.py | grep print\n\n简单搜索：直接输入你要查询的内容，回车即可打开默认浏览器进行搜索。\n\n有道词典：https://raw.githubusercontent.com/Louiszhai/tool/master/workflow/youdao.alfredworkflow\n\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-005-6ac95e32f7f7.png)\n\nIP 查询：\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-006-424fff913012.jpg)\n\n指定微信好友聊天：\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-007-01d4955ec13c.jpg)\n\n百度地图搜索：\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-008-ea81b629357a.jpg)\n\n豆瓣电影搜索：\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-009-417cd778ab7f.jpg)\n\n自定义搜索：\n\n```csharp\nstring str1 = String.Empty;\nstring str2 = String.Empty;\n\nstr2 = String.Intern(sb.ToString());\n\nif((object)str1==(object)str2)\n    Console.WriteLine(&quot;The strings are equal.&quot;);\nelse\n    Console.WriteLine(&quot;The strings are not equal.&quot;);\n\n```\n\n### 编辑器\n\n主力编辑器：Atom\n\nIntellij IDEA\n\nSublime Text\nOpen Sublime with terminal: https://ashleynolan.co.uk/blog/launching-sublime-from-the-terminal\n\n### brew软件管理\n\nBrew：https://brew.sh/\n\n```csharp\nstring str1 = String.Empty;\nstring str2 = String.Empty;\n\nstr2 = String.Intern(sb.ToString());\n\nif((object)str1==(object)str2)\n    Console.WriteLine(&quot;The strings are equal.&quot;);\nelse\n    Console.WriteLine(&quot;The strings are not equal.&quot;);\n\n```\n\n### 开发工具\n\nDash，离线api文档，搭配aflred食用体验更佳（后文有aflred）\n\n### 自动化工具\n\n简单：Automator：定制自动化流程，可以配合shell和apple script脚本\n\n  * 从PDF文件中提取文本\n  * 批量重命名一组照片\n\n高级：Jenkins\n\n### 其他工具\n\nFTP登陆：Cyberduck代替了之前的FileZilla\n\n## app\n\nGo2Shell\n1password，密码管理软件，多终端密码管理\n\n## 常用设置\n\n## 网络相关\n\n### 常用命令\n\nifconfig: 查找本机IP地址和网络接口。\nnetstat: 使用-r来找到特定网络接口的默认网关。\nping: 用来测试本机之间的端对端的IP连接。\narp: 管理本地的ARP缓存。\n\n#### ping\n\nICMP（Internet Control Message Protocol）\n如果本地连接是同的并且目的主机也是在线上并且是可以达到的，你将会输出每个ICMP（Internet Control Message Protocol）回显请求来显示每个ICMP回显应答。\n\n### 共享\n\n![](assets/0027 - 【OS Unix-like】MacOS开发与使用技巧__resource-002-ab9b71d9d1e0.png)\n\n  * 互联网共享 - 把以太网接口的网络共享成 Wi-Fi\n\n### 远程访问\n\n> 与防火墙无关\n\n“系统偏好设置”->“共享”->“远程登录”。\n\n> 可以指定哪些用户可以登录\n\nssh username@IPAddress\n\n## Ref\n\nhttps://www.zhihu.com/question/20873070\nhttps://github.com/hzlzh/Best-App\nhttps://www.zhihu.com/question/20656680\nhttps://www.zhihu.com/question/20656680/answer/427583008\n"
}
