Created symbolic link is not searchable? - macos

I don't know what is wrong here, I just created a symbolic link in my Mac's terminal as follow:
sudo ln -s ../../System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib /usr/lib/libatlas.dylib
And when I search libatlas.dylib the locate command can't find it:
locate libatlas.dylib
No results for the locate command. Any hint or remark are welcome. thanks

locate doesn't search your file system; it merely reports what it finds in the database refreshed by updatedb (which is run periodically by cron). Either run updatedb manually, or wait until the next time your system runs it. Then locate should find the file.

You presumably want to create an absolute symlink to a library so why the ../.. ?
Symlinks store whatever you give them

Related

Can't see files with Symlink

I need my client to be able to see the file in the directory they are allowed on. So I soft link the directory they are allowed on but can't see the files inside even tho they have the right (rwx).
ex:
/home/user1/project1.link/(couple of files)**
/clients/client_shamwow/project1/(couples of files)
**: Can't see the files.
This is the line I used:
ln -s /clients/client_shamwow/projet_prod /home/user1/projet_prod
is there something wrong that I am doing so they can't see the files in project_prod or I should use something else?
Your command doesn't match your example, but I assume you mean /home/user1/project1.link is a soft (symbolic) link, and when you run ls it lists just that name, rather than the contents of the directory the link points to. If that's the case, add the -L option to your ls command.
ls -lL /home/user1/project1.link
The man page says:
-L, --dereference
when showing file information for a symbolic link, show information
for the file the link references rather than for the link itself
Another way is simply to append /. to the end of your command, as in
ls -l /home/user1/project1.link/.
If that doesn't answer your question, I think you need to be more clear, and perhaps clean up the inconsistencies in your question. Even show some real output and the commands you ran.
Solved. No idea what happend. I just recreated the link the exact same way I did before and now I am able to see AND modify the files as the user1 w/o him being able to go anywhere else than what is in the folder project_prod. Thx for your time :)

Mac OSx 7zcat command not found

I am trying to execute a Makefile script and my Mac complains about 7zcat, although I already have 7z installed.
/bin/sh: 7zcat: command not found
Any thoughts on what's missing on my system? Thank you!
I have never used 7zcat before.
However, it looks like it needs to be installed on your system.
https://github.com/essentialkaos/7zcat
Also, after you download install 7zcat you have to give it execute permission with chmod. Finally, you have to execute it by calling its full path for example if you installed it to the directory you are in you would run ./7zcat file.7z or you would add the path to the file to your environment's $PATH variable.
I hope this helps. You might have to do some more research though.
When you open a Terminal window and type 7zcat and hit enter, what happens? Same message? Well, if you cannot use it, why should make be able to use it? Where and how have you installed 7z? Is the folder with the 7z binaries in your PATH? Since if it isn't, of course the command won't be found.
When the system shall run a command, it will search for this command in the directories stored in the PATH variable. Execute echo $PATH in terminal and you will get a colon separated list of directories; only these directories are searched for binaries. So either you must move your binaries to one of these (or put a symlink to one of these) or add the directory with these binaries to the PATH.
Yet there is no official 7z command line installer for MacOS, which brings me back to the original questions "Where and how have you installed 7z?" And are you sure that whatever you installed even includes a 7zcat?

mklink: How do you make a symbolic link to a file in command prompt when the file aready exists?

Coming from a unix-based environment, I expected to be able to create symbolic links in a Windows 7 command prompt using mklink or a similar function. Indeed, I find that I can do this, but if the link already exists, I find I cannot overwrite the link with a 'force' option, as you can in unix with ln -sf.
Is there a way that I can create a symbolic link with the same name and overwrite any existing link, all in one command? I'm surprised that the list of options here doesn't allow this, from what I've seen.

Can't create a symbolic link with Textmate in Terminal. (mate: command not found)

I'm currently going through http://ruby.railstutorial.org/ and it uses the command "mate" to access Textmate through the terminal. I have had Textmate on my Macbook Air (Lion OS) since I first bought it, but when I try to use a command like "mate .gitignore" the terminal gives me "mate: command not found".
I've looked through all other StackOverflow questions regarding this topic and have done the following:
Attempted to create a symbolic link through the terminal with this code.
$ sudo ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/bin
This code lets me enter my password and tells me the file exists, but still does not allow me to use the "mate" command.
Accessed Textmate/Help/Terminal Usage and tried to create a link for /usr/bin only for it to say operation not permitted.
Used alias mate='open -a textmate'. This works; however, I have to do it every time I open Terminal.
So, my question is can anyone tell me what is wrong? Love to figure this out!
Thank you!
First, you should not add anything to /usr/bin. You should add it into /usr/local/bin. Further, getting the message "file already exists" from ln means that it did not create the link. Try this:
ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/local/bin/mate
Depending on your current setup, this may have to be run with sudo. In general, if you don't know whether to run something with sudo or not, try without first and see if you get a permissions error, then use sudo.
The best way to do it is from TextMate -> preferences -> Terminal and then check install
all the previous methods didn't work for me.

Bookmark Directories In Terminal

Looking for a solution to quickly navigate to long paths in a shell (particularly Max OS X Terminal.app).
Say my path is ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
Instead of cd ~/This/Is/A/....
I would like to be able to store favorites/bookmark directories so I could do "cd myPath"
Are there any binaries or tools available to do something like this?
I've found the packages 'Apparix' and 'Goto' which together make the stuff dreams are made of for us terminal junkies.
Naturally, I had trouble installing Apparix, but I figured it out in the end.
How To Install Apparix on Mac OS X:
Download the tarball from Apparix's homepage.
Unpack the tarball, cd to the unpacked folder.
Run this command ./configure --prefix=$HOME/local && make && make install.
Run man apparix, scroll down to the heading BASH-style functions, copy everything within that section (delimited with ---) and paste it into ~/.bash_profile.
That's it. You should now have Apparix up and running on OS X (further install info and usage is on Apparix's homepage).
Another solution is to use Bashmarks, which allows you to this
$ cd ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
$ s shortname # save current path as `shortname`
$ cd /
$ g shortname # cd to ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently
You can use aliases (stick them in your ~/.bash_profile if you want them to always load)
alias cd_bmark1='cd ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently'
Then use by just typing
cd_bmark1
into the console
I know you already found an answer that worked for you, but a couple of more lightweight suggestions that might help others looking for similar things
If your directories are relatively fixed, just long and far away from each other, you can use the CDPATH environment variable to add directories to the search path when typing the "cd" command. If the directory name you try to cd to isn't in the current directory, the other entries in your CD path will also be looked at (and it's also tab complete aware, at least in bash and zsh).
Switching to zsh rather than bash and using the excellent directory stacks abilities. With it, you can maintain a history of directories that you've visited, view the history with the "dh" alias, and easily switch to a directory by using quick shortcuts (ex: cd -3 to switch to the 3rd directory in your history stack).
Why not having a symlink ?
ln -s ~/This/Is/A/Really/Long/Path/That/I/Would/Rather/Not/Type/Frequently bmark
cd bmark
I use to.sh daily to create and navigate bookmarked paths in bash. It supports tag autocompletion and the ability to easily add/remove bookmarks.
https://github.com/Grafluxe/to.sh
Full disclosure, I wrote this tool :)

Resources