LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-17-2009, 04:36 PM   #1
AlphaLexman
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Rep: Reputation: 0
creating a link to a deeply nested folder like ~ = /home/username/


I have an external hard drive mounted at /media/exthdd/
On that hard drive I have folders: Music, Pictures, Videos, etc.

Can I make symbolic links to /media/exthdd/Music/ to say the root directory /_ ?

the directory /_ is empty I just want a quick method of typing to get me there much like [cd ~] gets me to my home/username folder.

I have my music organized by Artist/Year-Album/Track.Title.mp3

I want to be able to "cd /_" then "ls" and see all Artist folders.

This is probably very simple I am just not finding it.
 
Old 09-17-2009, 05:03 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I'm not sure what you mean by '/_'? You have or want a directory literally named 'underscore'? What I would do is 'ln -s /media/exthdd/Music/ ~/extmusic' or some such. Then 'ls ~/extmusic' should show you the 'Artist' directory.
 
Old 09-17-2009, 05:07 PM   #3
AlphaLexman
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Original Poster
Rep: Reputation: 0
I may be looking at the situation backwards but I did a mkdir /_ (just an underscore folder at the root directory)

Are you saying it would be better to link the /media/exthdd/Music/ to something else? I'm a little confused and turned around.
 
Old 09-17-2009, 05:09 PM   #4
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by AlphaLexman View Post
I have an external hard drive mounted at /media/exthdd/
On that hard drive I have folders: Music, Pictures, Videos, etc.

Can I make symbolic links to /media/exthdd/Music/ to say the root directory /_ ?

the directory /_ is empty I just want a quick method of typing to get me there much like [cd ~] gets me to my home/username folder.

I have my music organized by Artist/Year-Album/Track.Title.mp3

I want to be able to "cd /_" then "ls" and see all Artist folders.

This is probably very simple I am just not finding it.
It would be much simpler for you to create a desktop shortcut that launches your file browser initialized to the desired directory -- or create a shortcut within your file browser that allows you to go there with a click.

The easiest to explain would be a desktop shortcut -- it's just a plain-text file with certain content:

Code:
[Desktop Entry]
Encoding=UTF-8
Name=Music Browser
Exec=nautilus --browser /path/to/desired/directory
Terminal=false
Type=Application
Icon=system-file-manager
Put the above in a plain-text file with a name like "music_browse.desktop". Give it 755 permissions. Put it on your desktop. Click it.
 
Old 09-17-2009, 05:15 PM   #5
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Originally Posted by lutusp View Post
It would be much simpler for you to create a desktop shortcut that launches your file browser initialized to the desired directory
This assumes he has desktop shortcuts.

Quote:
Originally Posted by AlphaLexman View Post
I may be looking at the situation backwards but I did a mkdir /_ (just an underscore folder at the root directory)

Are you saying it would be better to link the /media/exthdd/Music/ to something else? I'm a little confused and turned around.
Okay, you can have a /_ but I don't think it's necessary or desirable. Yes, I'm saying you would probably most like to have the directory of audio files show up as though it were a directory in your home folder with all your other files.

If you really want the music to be in /_ then rmdir the underscore directory and ln -s the audio dir to /_. If you want it under the underscore directory, then don't rmdir and do ln -s to the underscore directory. But because of crypticness and permissions and so on, I just don't think it's an optimal idea. But it's your system!
 
Old 09-17-2009, 05:22 PM   #6
AlphaLexman
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Ok I tried slakmagik's orginial idea, it is close to what i want...

the ln -s ... post got me a folder in my home directory like this --

~/_/Music/Artist/...

one more nested folder than i am looking for. Maybe a little tweak to the command line?

lutusp gave me errors as I am running Xubuntu and don't have nautilus installed will it work with Thunar?

btw, root / or home ~ isn't really important as is the number of keystrokes from the command line
Getting closer, thanks!

Last edited by AlphaLexman; 09-17-2009 at 05:25 PM. Reason: added btw
 
Old 09-17-2009, 05:23 PM   #7
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
This discussion is fairly similar to an earlier discussion where the OP wished to make a "bookmark" to a certain location, so he/she didn't need to type a big long path with the `cd` command.

Maybe a bash alias is the answer here too? Though if you want a 'clickable solution' then it may not be the best idea in this case.

Check it out, just in case it suits you?

Sasha

Last edited by GrapefruiTgirl; 09-17-2009 at 05:24 PM.
 
Old 09-17-2009, 05:32 PM   #8
AlphaLexman
LQ Newbie
 
Registered: Jun 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Well thanks for the tip GrapefruiTgirl, an alias command may confuse other users in the house. But after giving it some thought I may actually need to use the root directory instead of my home user directory, so that the wife and son's user accounts have access to the Music also.
 
Old 09-17-2009, 05:52 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
lutusp's general idea is the right one. Get it right once, then copy to wife & son's home dirs.
The Ubuntu forums here or at Ubuntu will explain how to use Thunar. It's probably the same, just try it.
Its not generally recommended to be in the root dir for anything, especially if you are not the sysadmin.
 
Old 09-17-2009, 06:31 PM   #10
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Quote:
Originally Posted by AlphaLexman View Post
the ln -s ... post got me a folder in my home directory like this --

~/_/Music/Artist/...

one more nested folder than i am looking for. Maybe a little tweak to the command line?
Why do you want an underscore? I feel like we're not communicating something here. If it's one too deep, remove the link and do it again. The link is like a copy command - you want "this" file linked "there". You don't need a special directory to contain the link. If you want ~/Music/Artist and the source has the structure /path/Music/Artist, then 'ln -s /path/Music ~/Music'. If you want ~/_/Artist (for whatever reason), then 'ln -s /path/Music ~/_'.

If you want the wife and son to have access, they should also have home directories with unprivileged accounts and can have links made in their home directories.

The problem with lutusp's method is that it only works from that link on that desktop. A filesystem symlink will work in every desktop, every file manager, and from the command line.

But if this is a "permanently mounted" removable drive, so to speak, then it should readable by them wherever it is. If the objective is simply to have a handy way to get it then, as GrapefruiTgirl suggests, there are multiple ways to achieve that. Unfortunately, many of those methods have the inverse problem of only working from the shell.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mixed mounting of automount and fstab in one folder? &different home folder using NIS herofmm Linux - Software 0 04-06-2009 11:00 AM
Can I recover from creating a symbolic link with the same name as an existing folder? serutan Linux - Newbie 3 10-07-2007 04:20 AM
Home folder icon does not open home folder CiscoGeek Linux - Newbie 3 12-18-2006 07:00 AM
I can not open the user folder in home and write in a shared folder jorge_ivan Linux - General 8 08-02-2006 11:28 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration