---
title: "MacOS使用技巧"
author: "Perrin Yong"
author_profile: https://www.pystone.net/profile/
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/macos-usage-tips/
type: note
content_role: unspecified
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/03-软件工程与质量保障/CI-CD与质量保障/CI-CD工具链/MacOS使用技巧.md"
content_hash: a8177f4c6ee3437a6a521b05cedceeee529d82c7bd0643010126137107aa5f32
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
# MacOS使用技巧

> 创建时间：2020/10/19 14:58

  * MacOS使用技巧
    * 手势操作
    * 快捷键
      * System
      * 通用 General
      * 截屏
      * Finder
      * 浏览器Safari
    * brew
      * 关于ruby
      * brew安装
      * brew使用
    * Mono On MacOS
      * 安装
      * 使用
    * Ref

## 手势操作

多桌面——四指向上拖 | Control + 方向键

## 快捷键

输入法 ctrl + space

### System

cmd + option + esc 强制退出程序
cmd + space 切换输入法

### 通用 General

cmd + H Hide the window
cmd + M Minimize the window
cmd + O Open files
cmd + s Save
cms + shift + s Save as
cmd + W Close
cmd + Q Quit

Return 重命名

### 截屏

cmd + shift + 3 截取整个屏幕
cmd + shift + 4 截取选择区域
cmd + shift + 4 + space 截取选择窗口

### Finder

cmd + sft + . 显示隐藏文件
option + cmd + i 查看多个文件或文件夹大小
右键目标文件 + option 复制目标文件的路径
cmd + [ / ] 前进或后退
cmd + up / down 进入上级目录 / 下级目录
option + up / down 定位到多文件列表顶部/底部
shift + cmd + g 路径进入文件夹
cmd + f 查询
cmd + N 新建文件夹
cmd + Delete 删除
cmd + shift + delete 清空回收站

cmd + c 复制
cmd + v 粘贴
cmd + option + v 粘贴后删除源文件（等效于Windows的ctrl + x, ctrl + v）

### 浏览器Safari

cmd + +/- 放大/缩小
cmd + T 新建选项卡
cmd + N 新建窗口
cmd + R 刷新
xmd + F 搜索
cmd + W关闭选项卡

## brew

brew 是 Mac 下的一个包管理工具，作用类似于 centos 下的 yum。brew 可以用一条命令，就可以在mac上安装、卸载、更新各种软件包。

### 关于ruby

  * Ruby是一种纯粹的面向对象编程语言。

  * Ruby是一种通用的、解释的编程语言。

  * Ruby是一种真正的面向对象编程语言。

Ruby教程: <https://www.runoob.com/ruby/ruby-installation-unix.html>

brew是ruby开发的。需要确认ruby是否已安装，默认是已经安装的。

```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```

### brew安装

国外：

```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```

解决brew更新慢的问题：
使用中科大的镜像
第一步，替换brew.git

```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```

第二步：替换homebrew-core.git

```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```
```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```

### brew使用

> homebrew的命令是以brew开头
>  homebrew 的默认安装目录为 /usr/local
>  通过 brew 安装的程序都会默认安装到 /usr/local/Cellars/程序名/版本号/ 目录下

```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```

如果需要安装指定版本的软件，执行 `brew search` 查看有没有需要的版本 在 @ 后面指定版本号，例如 brew install thrift@0.9

其他示例

```cpp
string str1 = &quot;test&quot;;
string str2 = &quot;test&quot;;

```

升级brew用`brew update --verbose`可以显示详细信息。

## Mono On MacOS

You can use Mono either as a runtime to run existing application, or as an SDK to develop new applications with Mono.

### 安装

下载：<https://www.mono-project.com/download/stable/#download-mac>
Run the .pkg file and accept the terms of the license.

  * This package installs as a framework into `/Library/Frameworks/Mono.framework` (the same way the Java packages are installed).

  * The executable binaries can be found in `/Library/Frameworks/Mono.framework/Versions/Current/bin`

  * If you’d like to access the mono manpages you’ll have to add /Library/Frameworks/Mono.framework/Versions/Current/man to your manpath.

### 使用

To build applications you can use `mcs`.
To run then you can use `mono`.

## Ref

<https://www.jianshu.com/p/c42f2cda860e>
