LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-04-2005, 10:01 AM   #1
manojg
Member
 
Registered: May 2004
Posts: 78

Rep: Reputation: 15
file link with same name


Hi,

I am trying to link a file with same name. For an example:

ln -s /home/john/data/abc.dat /home/john/data/abc.dat


Here the file abc.dat to be linked is in the directory /home/john/data/ . I want to put the linked file name /home/john/data/abc.dat in the directory /home/bartha/data/
I am working from the directory /home/bartha/data/.

I tried but linux does not allowed to put the name of the linked file with / or with directory name. Is there any trick?

Thanks.

Last edited by manojg; 11-04-2005 at 01:24 PM.
 
Old 11-04-2005, 10:16 AM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
If you're in /home/bartha/data/ you can just do: ln -s /home/john/data/abc.dat .
where "." at the end means the current dir

Hmm, you realise of course that bartha would need read access to johns home. Not a good solution. Instead put the file somewhere outside of /home

Last edited by makuyl; 11-04-2005 at 10:18 AM.
 
Old 11-04-2005, 10:31 AM   #3
manojg
Member
 
Registered: May 2004
Posts: 78

Original Poster
Rep: Reputation: 15
sorry, I forgot to mension that there is read permision. I have given bartha just as an example.

Actually, I am doing some analysis of the data. The data are on the NFS disk which can be accessed. I want to creat the link of those data files to my home directory. Also, I want to give the complete name of the data file (including directories) as the name of the linked file so that I can find out which data file I am using.
 
Old 11-04-2005, 12:49 PM   #4
sundaraz
LQ Newbie
 
Registered: Oct 2005
Location: Wisconsin
Distribution: Fedora Core 4
Posts: 15

Rep: Reputation: 0
I don't think its possible to have '/' as part of the filename.
 
Old 11-04-2005, 02:37 PM   #5
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
I seem to have misunderstood the question, also I don't know of a way to accomplish that. A weirdish workaround would be:
ln -s /home/john/data/abc.dat /home/bartha/data/home_john_data_abc.dat
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I know if a file has a hard link to it? granny Linux - Newbie 13 04-04-2015 05:02 AM
unable to link file cboothe SUSE / openSUSE 2 09-01-2005 12:20 PM
Debian and Mandrake on smae disk? NCC-1701&NCC-1701-D Linux - Newbie 1 06-09-2005 10:54 AM
Copy File as a Link Gerardoj Linux - General 3 12-02-2003 10:34 PM
How do I link a missing file? cbjhawks Linux - Software 1 07-16-2003 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:56 PM.

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
Open Source Consulting | Domain Registration