Too many levels of symbolic links osx Lion - xcode

i'm try to install a libraries but when the make file try to attempt to Developer folder it appear message
Too many levels of symbolic links.
So i try:
Go home folder (cd /)
then i try:
bash-3.2# cd Developer
and this is the output:
bash: cd: Developer: Too many levels of symbolic links
what could be the problem? can you help me?
ls -l
says me
lrwxr-xr-x 1 root wheel 10 14 Mar 09:13 Developer -> /Developer

Use absolute paths when making symlinks:
Doesn't (always) work:
ln -s file ../new/path
Works (more often):
ln -s /full/path/to/old/place/ /full/path/to/new/place/

If go to:
cd /
and ls -la outputs:
lrwxr-xr-x 1 root wheel 10 14 Mar 09:13 Developer -> /Developer
That's a problem. /Developer should be a folder, not a symlink pointing to itself.
Find out where the original /Developer directory is and delete the symlink, so you can create one pointing to it. If you can't find it, consider reinstalling XCode.

Related

Add executable to /usr/local/bin: command not found (macOS)

I made a simple program in ruby. The file has the shebang at the top and it is executable. When I run it (./parser.rb), it works.
I then created a symlink using ln -s parser.rb refs.
I then moved this symlink to /usr/local/bin. I restarted my terminal and ran refs, this gave me the following message:
zsh: command not found: refs
I cheched my path variable:
jonaseveraert#MacBook-Air-van-Jonas bin % echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/jonaseveraert/.cargo/bin
So that seems fine. I then went into the directory /usr/local/bin looked for the file:
jonaseveraert#MacBook-Air-van-Jonas bin % ls -l | grep refs
lrwxr-xr-x# 1 jonaseveraert staff 9 25 jan 14:14 refs.rb -> parser.rb
So, the file is there, but running it inside of the directory gives me:
jonaseveraert#MacBook-Air-van-Jonas bin % ./refs
zsh: no such file or directory: ./refs
Is there anything I'm forgetting here? I can't seem to find an answer to this.
I have found the solution here. The problem was that I made the symlink inside of the same directory as parser.rb and then moved it to /usr/local/bin
When running
jonaseveraert#MacBook-Air-van-Jonas bin % ls -l | grep refs
lrwxr-xr-x# 1 jonaseveraert staff 9 25 jan 14:14 refs.rb -> parser.rb
It shows that refs.rb is pointing to parser.rb in the same directory, but it's parser.rb that isn't there (because it's in another directory).
So, I executed /Users/jonaseveraert/Documents/projects/academic/parser/parser.rb refs inside of /usr/local/bin and now:
jonaseveraert#MacBook-Air-van-Jonas bin % ls -l refs
lrwxr-xr-x 1 jonaseveraert admin 65 25 jan 15:36 refs -> /Users/jonaseveraert/Documents/projects/academic/parser/parser.rb
The file is now pointing to the right file and can be executed using refs.

mac permission download folder ls folder

I can't ls my /Users/alex/Downloads folder.
Other folders work normal.
touch blub.txt works.
via finder I see everything.
Permission are as followed:
613923 0 drwx---r-x# 4 alex staff 128B 29 Jan 22:21 Downloads
I don't understand the behaviour.

Can't rm -R directory MacOS Catalina

I deleted a system directory because Carbon Copy Cloner was unable to back it up and suggested replacing it. After deleting and restarting it was rebuilt by the system. However I could not delete the directory from the trash using standard methods or Terminal commands - even logged in as root. Even after disabling System Integrity Protection I had no luck.
Finder says:
The operation can’t be completed because the item “powerlog” is in use.
File was located here:
private>var>db>powerlog>
The directory that was recreated by the system contains subfolders and files but the directory in the trash has none:
sh-3.2# ls -la /Users/admin/Desktop/powerlog
total 0
drwxrwxrwx 3 root wheel 96 Oct 29 16:37 .
drwx------+ 9 admin staff 288 Nov 14 13:18 ..
Attempting rm -R give this result:
sh-3.2# rm -R /Users/admin/.Trash/powerlog
rm: /Users/admin/.Trash/powerlog: Directory not empty
I could not delete it after logging in as root either.
It appears no application is using the folder:
sh-3.2# lsof /Users/admin/.Trash/powerlog
sh-3.2#

Why can't I run the go binary from within the /bin directory?

I downloaded go1.7.5.darwin-amd64.tar.gz for osx 10.12.2.
Unpacked the tar and went to the /bin directory to see if the Go executable would run.
$ cd Downloads/go/bin
$ ls
total 54560
-rwxr-xr-x# 1 bryanwheelock staff 9884220 Feb 10 16:53 go
-rwxr-xr-x# 1 bryanwheelock staff 15065500 Feb 10 16:53 godoc
-rwxr-xr-x# 1 bryanwheelock staff 2976976 Feb 10 16:53 gofmt
bryanwheelock#Bryans-MacBook Fri Feb 10 16:57:45 ~/Downloads/go/bin
$ go version
-bash: go: command not found
When you type a command without giving the full path, your system will try to find it within all the folders provided in $PATH variable.
In typical Unix environment, your $PATH does not include "your current folder". So you need to either:
call go by its full path (i.e. $HOME/Downloads/go/bin/go); or
call go by its relative path (i.e. ./go); or
put $HOME/Downloads/go/bin in your $PATH variable; or
put . (Unix way of saying "your current folder") in your $PATH; or
put your go binary into folders that already in your $PATH. For example
sudo cp $HOME/Downloads/go/bin/* /usr/local/bin/.
sudo chmod +x go
seems like it does not have execute permission, so just change permission and run it then you should alias your go binary path to your environment to access binary every where.

Permission denied when trying to make sublime text shortcut

So I just started getting into using terminal to manage files etc, and I was trying to setup my sublime text shortcut using this line of code:
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
However, when I try to do this it says Permission Denied and I have no idea why. I am using a Mac running Mac 10.10.2.
For sublime text 3:
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
If you look at the permissions on /usr/local/bin you will see it is owned by root:
$ cd /usr/local
$ ls -l .
total 0
drwxr-xr-x# 8 root wheel 272 Apr 16 11:31 bin
drwxr-xr-x 3 root wheel 102 Apr 16 10:02 include
drwxr-xr-x# 3 root wheel 102 Apr 16 10:19 share
Therefore you need to use sudo to gain super user privileges. You will need to enter your user account password and you will need to be an Admin user (see System Preferences > Users & Groups):
$ sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin
Note that you don't need the trailing subl on the destination as ln will figure that out itself.
If you are on Mac, I would suggest creating a file /usr/local/bin/sublime or somewhere else on your PATH and putting open -a Sublime\ Text $# inside instead of creating a link. open -a tells Mac to open an application that is in your /Applications/ directory. and the $# symbol passes on any additional arguments that you supply to the script. Thus, you can open a file by doing sublime file.ext. That said, it is possible that your permission denial is that you don't have permission for the /usr/local/bin directory. If that is the case, you need to change the permission using chmod, or just put the script somewhere else like ~/bin
In addition, if you're using Sublime Text 3, this is the correct command for the symlink:
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Resources