ln

What is the Bash command to create a hardlink to a directory in OS X?

How do you create a hardlink (as opposed to a symlink or a Mac OS alias) in OS X that points to a directory? I already know the command "ln target destination" but that only works when the target is a file. I know that Mac OS, unlike other Unix environments, does allow hardlinking to folders (this is used for Time Machine, for example) b...

Unable to make symlinks effectively with target files of the same names

I have a list of dotFiles at my workarea. For example, .bashrc and .vimrc. I want to make a symlinks from them to my Home such that their names are the same as in my workarea -folder. My attempt in pseudo-code ln workarea/.[a-zA-Z] ~/.* The problem is to have a bijection from [a-zA-Z] to the files which occur in my Home. How can yo...

shell script to link specific files up one level

I've got a folder that's got a whole lot of folders inside, which each contain a movie file. Now I want to be able to see all these movies at one time (but I have to preserve the folder structure) so I wanted to symlink them all to the top level folder (flat view in Directory Opus would be the go here, but I'm on a mac). Here's my attemp...

Link to a specific inode

I have a file that was deleted, but is still held open my a program. I found the inode number using lsof. How can I create a hard link back to that inode? Any code helps, but Perl would be handy. ...

Randomizing function, etc. locations for shared libs

Currently, when I create a shared library, functions from within the same object files like to lie together. Is there a good solution (that does not involve splitting up source files) to try and spread function locations apart? We are currently using a cross-compiled, 4.2.1 version of gcc and the gnu tools. ...

LINUX: Link all files from one to another directory

I want to link ( ln -s ) all files that are in /mnt/usr/lib/ into /usr/lib/ There are lots of file, how to do it fast? :) ...

/usr/share/zoneinfo epic fail

I have just, in my groggy morning state, reversed & confused the arguments to ln, replacing /usr/share/zoneinfo/America/Toronto with a link to the non-existant /etc/localtime, when I really wanted to link /etc/localtime to Toronto. Now I have no timezone file for where I live. Does anybody have a copy or know where I could get one? It's ...

Create broken symlink with Python

Using Python I want to create a symbolic link pointing to a path that does not exist. However os.symlink just complains about "OSError: [Errno 2] No such file or directory:".. This can easily be done with the ln program, but how to do it in Python without calling the ln program from Python? Edit: somehow I really messed this up :/ ... b...

mdfind used for creating symlinks not working as expected.

I am trying to use the output from 'mdfind' to create a bunch of symlinks. Output of 'mdfind' is like this: /pathtofile1/ /pathtofile2/ /pathtofile3/ So, I used 'sed' to add 'ln -s ' to the start of each line, and awk {print $0 "/directory where I want this/"}; after my single-line script successfully outputs this: ln -s "...