Mac小知识点

Mac下如何显示隐藏文件

缺省情况下,在 Mac 下是不显示隐藏文件的,Finder 也未提供设置是否显示隐藏文件的选项,不像 Windows 下,有一个“文件夹选项“设置界面里可以控制,但这并不表示 Mac 下无法显示隐藏文件,我可以通过“终端”,用命令行设置这个选项,命令如下:

显示:defaults write com.apple.finder AppleShowAllFiles -bool true
隐藏:defaults write com.apple.finder AppleShowAllFiles -bool false

除了命令行设置外,也有第三方工具可以实现,有一个叫 OnyX 的程序可以实现,

 Vim 保存只读文件

'readonly' option is set (add ! to override)

Try the below command

:w !sudo tee %

Explanation

  • :w – write
  • !sudo – call shell sudo command
  • tee – the output of write (:w) command is redirected using tee
  • % – current file name

转自:http://stackoverflow.com/questions/28635647/how-can-i-save-a-file-i-opened-in-vim-as-the-wrong-user?answertab=votes#tab-top

Mac 终端常用命令

http://www.cnblogs.com/iphone520/archive/2012/03/26/2418468.html

原文地址:https://www.cnblogs.com/a0000/p/5140048.html