I've just changed my OS X / Mac main user - I've created a new 'coder' user account that I want to use for development instead of my old 'lombard' account. I realized that a lot of my applications I've previously installed via Homebrew now had to be changed to be owned by the new coder user. First I ran 'brew doctor' find see what obvious issues I have:

Gerts-Mac-mini:src coder$ brew doctor
Warning: /usr/local/etc isn't writable.
This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a brew tries to write a file to this directory, the
install will fail during the link step. You should probably `chown` /usr/local/etc
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools. Warning: You have an outdated version of /usr/bin/install_name_tool installed.
This will cause binary package installations to fail.
This can happen if you install osx-gcc-installer or RailsInstaller.
To restore it, you must reinstall OS X or restore the binary from
the OS packages. Warning: Git could not be found in your PATH.
Homebrew uses Git for several internal functions, and some formulae use Git
checkouts instead of stable tarballs. You may want to install Git:
brew install git Warning: No developer tools installed.
Install the Command Line Tools:
xcode-select --install
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

Indeed, several files/directories below '/usr/local' were created by Homebrew as user 'lombard':

Gerts-Mac-mini:src coder$ ls -l /usr/local
total 80
-rw-r--r-- 1 lombard admin 3158 5 Jun 09:16 CODEOFCONDUCT.md
-rw-r--r-- 1 lombard admin 687 5 Jun 09:16 CONTRIBUTING.md
drwxr-xr-x 4 lombard admin 136 17 Jun 17:11 Cellar
-rw-r--r-- 1 lombard admin 1253 5 Jun 09:16 LICENSE.txt
drwxr-xr-x 9 lombard admin 306 17 Jun 17:11 Library
-rw-r--r-- 1 lombard admin 1858 5 Jun 09:16 README.md
-rw-r--r-- 1 lombard admin 23719 5 Jun 09:16 SUPPORTERS.md
drwxrwxr-x 12 root admin 408 17 Jun 17:11 bin
drwxr-xr-x 3 lombard admin 102 17 Jun 17:11 etc
drwxrwxr-x 5 root admin 170 17 Jun 17:11 lib
drwxr-xr-x 3 root wheel 102 17 Jun 17:11 libexec
drwxrwxr-x 4 root admin 136 17 Jun 17:11 share

I can't just use 'chown -R' because I only want to change the owner of some specific files. To recursively fix/change the owner only of files specifically owned by another user, use the versatile 'find' command:

$ find . -user lombard -exec sudo ch
own coder {} \;

Now I just took care of the other things that brew doctor complained about:

$ xcode-select --install
$ brew update

That's it! Now I'm ready to install more tools using Homebrew using the new user account.

Recusively change the owner of files (chown) on Mac OS X的更多相关文章

  1. Mac OS finder : 显示和隐藏文件[夹] show and hide files or folders

    Finder默认是不显示隐藏文件[夹]的,要显示出怎么办? 要显示的话,可以GUI(graphic user interface)和CLI(command line interface)两种方式 CL ...

  2. Link all references for a local rename (does not change references in other files)

    这是一个十分easy的问题 错误原因  : import  Android.R; 把这句话去掉 ctrl + shift+o  引进一个  项目对应的R文件 R存在于gen文件夹下 可以找到 layo ...

  3. linux basic commands

    1. man - an interface to the on-line reference manuals $man man 2. apt - advanced package tool SEE A ...

  4. File System Shell

    Overview appendToFile cat chgrp chmod chown copyFromLocal copyToLocal count cp du dus expunge get ge ...

  5. Step one : 熟悉Unix/Linux Shell 常见命令行 (一)

    1.文件系统结构和基本操作 ls  - - list directory contents -a/A 列出全部文件(包含隐藏文件) - i 列出inode号码 -n 查看UID and GID -d ...

  6. 【转载 Hadoop&Spark 动手实践 2】Hadoop2.7.3 HDFS理论与动手实践

    简介 HDFS(Hadoop Distributed File System )Hadoop分布式文件系统.是根据google发表的论文翻版的.论文为GFS(Google File System)Go ...

  7. 【大数据系列】FileSystem Shell官方文档翻译

    appendToFile cat checksum chgrp chmod chown copyFromLocal copyToLocal count cp createSnapshot delete ...

  8. hadoop 文件操作

    Create a directory in HDFS - mkdir The hadoop mkdir command is for creating directories in the hdfs. ...

  9. Ubuntu notes

    ubuntu notes Table of Contents 1. backup data 2. Basics Ubuntu 3. Install, uninstall packages 4. Bas ...

随机推荐

  1. c++ 哈希表(hash表)

    一.定义 Hash表,也称散列表.一般应用于有大量"动态"的插入(删除)和查找操作的一类问题.(如果是"静态"的,通常可以先对数据排序,查找时就可以用" ...

  2. 数学图形(1.29) cochleoid曲线

    它也算是一种螺线吧 相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.该软件免费开源.QQ交流群: 367752815 #http://www.mathcurve.com/co ...

  3. 数学图形(1.28) EPI线

    貌似由双曲线组成的图形.有时会像个自行车的轮子. 相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.该软件免费开源.QQ交流群: 367752815 #http://www.m ...

  4. [Todo]提升电商网站性能方面的一些资料材料

    又到国庆,喷一喷12306.cn的技术架构 http://chengxu.org/p/369.html 其中用到了不少比较细节的优化技巧. 提到库存管理是电商非常难的地方.也讲了跟秒杀相关的一些内容.

  5. IOS NSNotification Center 通知中心的使用

    通知中心,它是IOS程序内部的一种消息广播机制,通过它,可以实现无引用关系的对象之间的通信.通知中心他是基于观察者模式,它只能进行程序内部通信,不能跨应用程序进程通信.当通知中心接受到消息后会根据设置 ...

  6. Sqlserver DateTime转换成SMALLDATETIME时“产生一个超出范围的值”

    工作中遇到一个问题,A表中字段(DateTime1)的数据类型为DateTime,新建了一张表B的SMALLDATETIME1字段的数据来自A表的DateTime1 但在将A表字段DateTime1导 ...

  7. RS报表自动适应屏幕分辨率大小

    问题:同一个报表,由于用户电脑显示器大小,分辨率大小不同显示的不一样,看起来不完整或者很不协调 原因:设计报表大小属性的时候使用了固定值属性,比如限制为宽:1200px 那么在电脑屏幕小分辨率很小的情 ...

  8. hdu 5247 找连续数(思维)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5247 找连续数 Time Limit: 2000/1000 MS (Java/Others)    M ...

  9. MongoDB 基础命令 (MongoDB Shell)

    1.我们 mongodb 安装成功后,用上一篇的方法启动 mongodb服务 然后使用 mongodb shell 来做数据库的增删改查 2.创建数据库 语法: use 数据库名称 案例: > ...

  10. OpenCV求取轮廓线

    // Threshold.cpp : Defines the entry point for the console application. // #include "stdafx.h&q ...