Visit Our UNIX and Linux User Community


links.... soft or hard.. not sure?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers links.... soft or hard.. not sure?
# 1  
Old 10-24-2002
links.... soft or hard.. not sure?

hi, i am in a directory, have 2 files as below
Quote:
filea
fileb
then do a ls -l gives the below

Code:
lrwxrwxrwx   1 root     system        23 Mar 08 2001    filea -> /adir/filea
lrwxrwxrwx   1 root     system        23 Mar 08 2001    filea -> /adir/fileb

now, when i do a cd /adir, the system said, adir not found..

so what is wrong?

Last edited by Yogesh Sawant; 11-09-2010 at 07:39 AM.. Reason: added code tags
yls177
# 2  
Old 10-24-2002
A link is just a entry in the directory I-node table.
It does not mean the tatget files exists.

You can re-create the targets and it should be working.


BUT I wonder how it is possible you have 2 files in the same directory with the same name (filea).

Is this an example?, or do you have blanks around the file name?, or is this you problem?
# 3  
Old 10-24-2002
is a problem that i am facing now... its a tying mistake should be.. as belows..

Code:
lrwxrwxrwx 1 root system 23 Mar 08 2001 filea -> /adir/filea 
lrwxrwxrwx 1 root system 23 Mar 08 2001 fileb -> /adir/fileb

sorry, but i still dont get ur replies...

when i do a cd /adir, the system said adir is not found

Last edited by Yogesh Sawant; 11-09-2010 at 07:40 AM.. Reason: added code tags
yls177
# 4  
Old 10-24-2002
When you do `ls -l` the command is looking in the I-node table and not on the disk.

So once when the link was created the dirtectoy /adir exists.
Afterwards someone deleted this directory /adir

you end up without directory /adir, and with a link
`filea -> /adir/filea`

When you recreate the directory and the file /adir/filea, the link should be re-astebilst

Last edited by janr; 10-24-2002 at 06:53 AM..
# 5  
Old 10-24-2002
if i recreate the directory, i think i wont be able to get the original files? say example, the links point to some pdf help files. when i had already deleted them, even if i restored the directory, i will not be able to get the help files, right?

another question that came across my mind is how to read pdf files in unix?

thanks
yls177
# 6  
Old 10-25-2002
Indeed, you do not get back the original files, Tape backup?
it only restores the link.

for reading PDF files, you need a PDF reader for your platform.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #232
Difficulty: Medium
The ARPANET project was formally decommissioned in 1994.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Soft links question

Hello. I have some main directories. For example : /main_dir1 /main_dir2In main_dir2, I have a sub dir named sub_dir2-1 with 2 files in it ( file_2-1, file_2-2 ) /main_dir2sub_dir2-1file_2-1 file_2-2From "/main_dir1/A/B/C" I make a soft link ln -s /main_dir2/sub_dir2-1 ... (6 Replies)
Discussion started by: jcdole
6 Replies

2. Shell Programming and Scripting

Timestamp change for hard and soft links

Hi team, i am writing a purge script to delete softlinks and hardlinks on linux system which are 3/10/30 days old. To test the script i need to create links with old timestamp, i am able to cange timestamp for files but not for links. i tried touch -h option but this option is not available on... (1 Reply)
Discussion started by: Satyak
1 Replies

3. UNIX for Dummies Questions & Answers

Simple example for soft and hard links

Hai, give me a simple example for soft and hard links. this will work for soft link ?? ln -s (2 Replies)
Discussion started by: Ramesh M
2 Replies

4. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

5. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

6. Programming

creating soft links

i'm trying to write a c code to copy a soft link over to a specified directory. Is it possible to do this without using symlink()? if so, what can I use? Thanks! (2 Replies)
Discussion started by: l flipboi l
2 Replies

7. UNIX for Dummies Questions & Answers

Command to find all soft links in a directory

I need the command to find all soft links in a directory. Can someone please help. Thank you. (2 Replies)
Discussion started by: jgeo01
2 Replies

8. Shell Programming and Scripting

using find to locate hard and soft links with tar

I am digging for certain types of files in the current directory and all its sub-directories and archiving them with the following code: #! /usr/bin/ksh Archive=`date +%Y_%m_%d_%T` find . -type f \( -name \*\.ksh -o -name \*\.sql -o -name \*\.ini \) -print|xargs tar -cf... (4 Replies)
Discussion started by: manthasirisha
4 Replies

9. UNIX for Dummies Questions & Answers

links: (soft, hard? symbolic??) inode

Hi, what is link? and soft link? how about hard one and symbolic link. and inode. i get confuse about this links. could anyone help me with full explainsion? thks Gusla (5 Replies)
Discussion started by: gusla
5 Replies

Featured Tech Videos