Recusively change the owner of files (chown) on Mac OS X
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的更多相关文章
- Mac OS finder : 显示和隐藏文件[夹] show and hide files or folders
Finder默认是不显示隐藏文件[夹]的,要显示出怎么办? 要显示的话,可以GUI(graphic user interface)和CLI(command line interface)两种方式 CL ...
- 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 ...
- linux basic commands
1. man - an interface to the on-line reference manuals $man man 2. apt - advanced package tool SEE A ...
- File System Shell
Overview appendToFile cat chgrp chmod chown copyFromLocal copyToLocal count cp du dus expunge get ge ...
- Step one : 熟悉Unix/Linux Shell 常见命令行 (一)
1.文件系统结构和基本操作 ls - - list directory contents -a/A 列出全部文件(包含隐藏文件) - i 列出inode号码 -n 查看UID and GID -d ...
- 【转载 Hadoop&Spark 动手实践 2】Hadoop2.7.3 HDFS理论与动手实践
简介 HDFS(Hadoop Distributed File System )Hadoop分布式文件系统.是根据google发表的论文翻版的.论文为GFS(Google File System)Go ...
- 【大数据系列】FileSystem Shell官方文档翻译
appendToFile cat checksum chgrp chmod chown copyFromLocal copyToLocal count cp createSnapshot delete ...
- hadoop 文件操作
Create a directory in HDFS - mkdir The hadoop mkdir command is for creating directories in the hdfs. ...
- Ubuntu notes
ubuntu notes Table of Contents 1. backup data 2. Basics Ubuntu 3. Install, uninstall packages 4. Bas ...
随机推荐
- HTML学习要点
目标 掌握HTML基本语法,了解HTML Document结构,能熟练使用HTML Element对象. 要点 基本概念:什么是HTML.HTML标签? 熟悉常用的HTML标签含义以及应用场合. ht ...
- LoadLibrary文件路径及windows API相关的文件路径问题
LoadLibrary HMODULE WINAPI LoadLibrary( _In_ LPCTSTR lpFileName ); Loads the specified module into ...
- Converting a fisheye image into a panoramic, spherical or perspective projection [转]
Converting a fisheye image into a panoramic, spherical or perspective projection Written by Paul Bou ...
- JSP学习笔记(一):JSP语法和指令
一.语法 1.脚本程序的语法格式: 脚本程序可以包含任意量的Java语句.变量.方法或表达式,只要它们在脚本语言中是有效的. <% 代码片段 %> 2.中文编码问题 如果我们要在页面正常显 ...
- laravel5.1安装
Laravel 于6月9日正式发布了 5.1 最新 LTS 版本.这是 Laravel 历史上第一个提供 LTS(长期支持 - long-time support) 支持的版本. 首先使用Larave ...
- RS布局问题之块的不完美之完美
早上一来,便传来喜讯...说我们做的报表太美.客户不敢看----于是便开启征程,亲自尝试了一把,如下面的操作,首次运行报表,在不考虑UI美观度的情况下,报表还是 在预测范围内显示的 那么接下来我们选择 ...
- 【php】Apache无法自己主动跳转却显示文件夹与php无法连接mysql数据库的解决方式
一.Apache无法自己主动跳转却显示文件夹 Apache无法自己主动跳转却显示文件夹这是由于Apacheserver下conf/httpd.conf没有配置好,其默认是不跳转,直接显示文件夹 首先, ...
- linux下vim命令具体解释
很具体的介绍linux中vim的操作命令. 高级一些的编辑器,都会包括宏功能,vim当然不能缺少了.在vim中使用宏是很方便的: :qx 開始记录宏.并将结果存入寄存器x q 退出记录 ...
- Samba简单教程+Samba中文显示问题
1.检测安装Samba服务(1).检查Samba服务包是否已安装:rpm -qa | grep samba(2).如未安装,则插入第一张安装盘,执行:mount /mnt/cdromcd /cdrom ...
- Android Service+Socket 联网交互
android中,联网操作有http连接和socket连接两大类.由于项目需要,我们采取的是Socket连接.鉴于平时连接频繁,因此把Socket连接放到Service里,需要从服务器端获取数据时,只 ...