程序员对Mac OS 初次使用的体验

程序员对Mac OS 初次使用的体验


DATE: 2017-09-08 09:43:55

作为一名屌丝,对Mac OS这样一款传说中的操作系统一直是只能远观。近日在姻缘巧合之下,有幸在公司得到一台Mac台式机,借此机会感受下与常用的Windows7以及CentOSUbuntuFedora等Linux1系列操作系统的感知差异。

联网(Mac OS 如何联有线网络)

这时我发现Mac的配置与Linux极其相似。(我的工作环境需要设置固定IP才可惜联网)

->左上角苹果图标->系统偏好设置->网络->以太网->设置IP

五笔输入法(Mac OS 如何使用五笔输入法)

->右上角输入法图标->输入偏好设置->“+”号增加输入法(“-”号是删除)->选择五笔(或拼音)

作为一名五笔玩家,刚开始发现Mac自带的五笔实在是不好用,很多时候只能的单字,许多的常用词组都不能识别,而且还不支持混输(这里指输入不流畅)。
不过,使用了一会之后,发现使用习惯的原因占很大的比重,所以耐心等自己慢慢习惯喽。

常用切换输入法的方式:

切换中英文方式:

  1. Ctrl + Space(空格)
  2. Caps Lock(大小写锁定)

打开终端(Mac OS 如何使用Terminal终端)

左下角Finder->应用程序->实用工具->终端

由于终端Terminal才是程序员最需要且最有用的应用,所以先将其放入下方的快捷方式。

到这里,发现 ls、cd、pwd等命令都是可以正常使用的,看来,传说Mac源于Unix的传言果然不虚。

增加root用户(Mac OS如何增加root用户)

macdeiMac:Applications xiaoqw$ su root
Password:
su: Sorry #这里还不能切换为root用户
macdeiMac:Applications xiaoqw$ sudo su
sh-3.2# passwd root
Changing password for root.
New password:
Retype new password:
sh-3.2# 
sh-3.2# 
sh-3.2# exit
exit
macdeiMac:Applications xiaoqw$ su #这里已经可以了
Password:
sh-3.2# 
sh-3.2# 
sh-3.2# ls

如何安装brew(Mac OS 如何用命令行的方式安装软件)

sh-3.2# curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1

安装后使用brew安装软件时出现几个ERROR:

Error: Unknown command: install
Error: Unknown command: uninstall

解决方法:

执行brew发现问题的原因是brew的版本需要更新,执行brew update,按照提示信息操作,最后解决问题。

主要命令:

macdeiMac:/ xiaoqw$ sudo chown -R $(whoami) /usr/local
macdeiMac:/ xiaoqw$ sudo chown root:wheel /usr/local
macdeiMac:/ xiaoqw$ brew update

具体过程记录如下:

macdeiMac:/ xiaoqw$ brew
Please run brew update!
macdeiMac:/ xiaoqw$ brew update
Error: /usr/local must be writable!
macdeiMac:/ xiaoqw$ su
Password:
sh-3.2# brew update
Initialized empty Git repository in /usr/local/.git/
remote: Counting objects: 1122, done.
remote: Compressing objects: 100% (1032/1032), done.
remote: Total 1122 (delta 117), reused 380 (delta 50), pack-reused 0
Receiving objects: 100% (1122/1122), 1.20 MiB | 1.15 MiB/s, done.
Resolving deltas: 100% (117/117), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
HEAD is now at 5b04152 Merge pull request #3133 from MikeMcQuaid/travis-umask
To restore the stashed changes to /usr/local run:
  'cd /usr/local && git stash pop'
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
sh-3.2# exit
exit
macdeiMac:/ xiaoqw$ sudo brew update
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
macdeiMac:/ xiaoqw$ brew update
Error: /usr/local is not writable. You should change the
ownership and permissions of /usr/local back to your
user account:
  sudo chown -R $(whoami) /usr/local
macdeiMac:/ xiaoqw$ sudo chown -R $(whoami) /usr/local
macdeiMac:/ xiaoqw$ brew update
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

==> Tapping homebrew/core
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4556, done.
remote: Compressing objects: 100% (4344/4344), done.
remote: Total 4556 (delta 36), reused 461 (delta 12), pack-reused 0
Receiving objects: 100% (4556/4556), 3.63 MiB | 5.78 MiB/s, done.
Resolving deltas: 100% (36/36), done.
Checking out files: 100% (4577/4577), done.
Tapped 4341 formulae (4,601 files, 11.3MB)
Already up-to-date.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.
==> Migrating HOMEBREW_REPOSITORY (please wait)...
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
macdeiMac:/ xiaoqw$ sudo chown root:wheel /usr/local
macdeiMac:/ xiaoqw$ brew update
Already up-to-date.
macdeiMac:/ xiaoqw$ brew
Example usage:
  brew search [TEXT|/REGEX/]
  brew (info|home|options) [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install -vd FORMULA

Developers:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  https://docs.brew.sh/Formula-Cookbook.html

Further help:
  man brew
  brew help [COMMAND]
  brew home

本文先写这些,后绪有空再更新。

版权声明

弈心博客


本文首发site_name,转载请附上博文链接!