Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to replace the folders in my home/ directory with symlinks to folders in another location, but I want to retain the folder emblems without having to go searching for them. How do I do this?

To illustrate what I'm asking, the directories in the home folder have nice emblems that look like this:

Music folder with music emblem

If I just delete this folder and replace it with a symlink the music emblem is lost and replaced by a link emblem.

Music symlink with link emblem

I want it to have have both the music emblem and the symlink emblem, like this:

Music symlink with music and link emblems

Preferably I'd like to be able to do this without having to manually hunt down and set the icon for the folder (but a good answer explaining how to do so would be upvoted as a good alternative).

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

This can be done using the "merge folder" functionality of Nautilus (the default file browser in Ubuntu).

Simply create the symlink in another location with the same name as the folder you want to replace, then copy and paste it into your home folder.

A dialog will appear asking if you want to merge the folders and you should click the Merge button and you will now have a new symlink with name and folder emblems of the old folder.

WARNING: From my testing, this doesn't appear to be a true 'merge' (it's more like a useful--albeit potentially dangerous--bug), any files or subdirectories in the folder you are replacing with the symlink appear to be deleted (aka, only replace empty folders if you don't want to lose files). Proceed with caution!

WARNING: Also, absolutely do not replace a folder that itself contains symlinks or it will follow the symlinks and recursively delete everything in the target directories.

Merge Folder Dialog

This gets the job done, but if someone knew a command line alternative with the same results I would be very happy.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.