find command:
The make the /usr/local/bin/makelink file as mentioned above. (If you don't have access permissions, create $HOME/bin and put it in there; change the find command appropriately.)
The missing part in the script should be something like this:
This will work for just about any number of files. Example:
Perl does two substitutions (stuff between s/.../. The first looks for a period NOT preceded by a digit that is followed by a right-bracket. If it finds such a string, it replaces it with [0]. The next looks for a number inside brackets and followed by a period. If it finds such a thing (which it will if the previous step succeeded, or as it must if the previous step failed) it replaces the number found with the next higher number (just adds 1).
The output is sent to the shell which stores that output in the variable "file". The next iteration of the while loop should fail, and then the ln command will do its thing.
Hi all!
I'd like to know the differences between hard links and soft links. I've already read the ln manpage, but i'm not quite sure of what i understood.
Does a hard link sort of copy the file to a new name, give it the same inode number and same rights?
What exactly should I do to do this:... (3 Replies)
Hi
PLease let me know the usage of Hard Link vs Soft Link
i.e what is the basic difference and what happens when one file is changed or deleted in both the cases???
thanks (3 Replies)
Hi Experts,
Please help me out to find out difference between a hard link and a soft link.
I am new in unix plz help me with some example commands ( for creating such links).
Regards
S.Kamakshi :) (2 Replies)
I was wondering if it was at all possible to change the timestamp of a soft link. I want to change it to a time in the past before it was created.
Sceanrio:
In a directory i have a number of softlinks whih point to files, a script processes these files oldest first bassed on the time the... (8 Replies)
Hi ,
When installing oracle software a set of directories are created under
the home directories.
Since the home directory is usually not big , i would like to create a soft link
from the home directory to mount point with alot of free space , that way the logs will not be wriiten under the... (1 Reply)
hi
i have create a soft link using below command.
ln -s <filename> <dirmane>where file name i use is t1 and dir name was t2.
i deleted the dir t2 using command rm -rf to remove the soft link .
however again i create a file a using the name t2 and when i just try to link t1 to t2 ... (1 Reply)
I did restore from netbackup for root file system on separate slice instead of corrupted one. After restoration I found there are number of soft link issues lie
e.g
libabcxyx > /mnt/usr/lib
it should be
libabcxyz > /usr/lib
does any have solution to change symbolic link changed in... (1 Reply)
Hi All,
I tried creating a soft link with the file itself. It got created successfully.
bash-3.2$ ls -l a
lrwxrwxrwx 1 ebrigup other 1 Oct 5 19:14 a -> a
bash-3.2$
Can anyone explain what is the possible use of it. I dont see any except practically wasting an inode... (2 Replies)
Discussion started by: brij123
2 Replies
LEARN ABOUT XFREE86
lndir
LNDIR(1) General Commands Manual LNDIR(1)NAME
lndir - create a shadow directory of symbolic links to another directory tree
SYNOPSIS
lndir [ options ] fromdir [ todir ]
DESCRIPTION
The lndir program makes a shadow copy todir of a directory tree fromdir, except that the shadow is not populated with real files but
instead with symbolic links pointing at the real files in the fromdir directory tree. This is usually useful for maintaining source code
for different machine architectures. You create a shadow directory containing links to the real source, which you will have usually
mounted from a remote machine. You can build in the shadow tree, and the object files will be in the shadow directory, while the source
files in the shadow directory are just symlinks to the real files.
This scheme has the advantage that if you update the source, you need not propagate the change to the other architectures by hand, since
all source in all shadow directories are symlinks to the real thing: just cd to the shadow directory and recompile away.
The todir argument is optional and defaults to the current directory. The fromdir argument may be relative (e.g., ../src) and is relative
to todir (not the current directory).
If you add files, simply run lndir again. New files will be silently added. Old files will be checked that they have the correct link.
Deleting files is a more painful problem; the symlinks will just point into never-never land.
OPTIONS -silent
Normally lndir outputs the name of each subdirectory as it descends into it. The -silent option suppresses these status messages.
-silent may be abbreviated to -s.
-ignorelinks
If a file in fromdir is a symbolic link, lndir will make the same link in todir rather than making a link back to the (symbolic
link) entry in fromdir. The -ignorelinks option changes this behavior. The link created in todir will point back to the corre-
sponding (symbolic link) file in fromdir. If the link is to a directory, this is almost certainly the wrong thing. The -ignore-
links option may be abbreviated to -i.
-withsymdirs
If a file in fromdir is a symbolic link to a directory and the -withsymdirs option is specified, lndir will shadow the directory
tree the symbolic link points to, whether or not the -ignorelinks is also specified. The -withsymdirs option may be abbreviated to
-d.
-clean lndir will remove dangling symbolic links and empty directories in the shadow tree. The -clean option may be abbreviated to -c.
-cleanonly
lndir will do the cleaning phase only, not creating the shadow tree. The todir argument may be provided, and defaults to the cur-
rent directory when not provided.
-withrevinfo
lndir will normally not shadow any BitKeeper, RCS, SCCS, CVS, CVS.adm and .svn subdirectories, nor any .cvsignore and .gitignore
files. This option causes these directories and files to be treated as any other, rather than ignored. -withrevinfo may be short-
ened to -r.
-noexceptions
By default, lndir does not shadow files or directories whose name is .DS_Store, or ._.DS_Store, or starts with '.#', or ends in '~'.
This option, which may be abbreviated to -E, causes such files to also be shadowed.
-except
This option adds name to an initially empty list of filenames in fromdir that are not to be shadowed. -except may be specified as
-e. This option may be repeated as many times as necessary.
DIAGNOSTICS
The program displays the name of each subdirectory it enters, followed by a colon. The -silent option suppresses these messages.
A warning message is displayed if the symbolic link cannot be created. The usual problem is that a regular file of the same name already
exists.
If the link already exists but doesn't point to the correct file, the program prints the link name and the location to which it does point.
XFree86 Version 4.7.0 LNDIR(1)