12-01-2009
Don't worry. Symbolic links (or any link, for that matter) don't really affect the original file per se. A symbolic link in UNIX is just a directory entry (in your case in /tmp) which tells any process accessing it that the files contents are in /origin.
With hard links both directory entries (the original and the link) become equivalent so that there's no telling which one was there first, as both point to the same inode.
10 More Discussions You Might Find Interesting
1. IP Networking
Hi guys,
I have set up multiple virtual FTP servers on a server through one physical NIC. I believe there are to ways; setting logical or alias ip's. I would like to know what is the difference between setting up a logical ip or setting up an alias ip to a physical network interface? Some links to... (5 Replies)
Discussion started by: zaff
5 Replies
2. UNIX for Dummies Questions & Answers
I am trying to create an alias for a frequently used directory path by using
alias xyz="/proj/dir_name"
and then trying to reach a sub-directoy by using
cd xyz/abc
but I get an error saying " No such file or directory "
plz tell me wats wrong with this ... (3 Replies)
Discussion started by: jasjot31
3 Replies
3. Shell Programming and Scripting
Hi folks,
I'm trying to define the following command as alias in .cshrc file:
ls -ltr | grep ^d | awk '{print $9}' | xargs du -hs
I defined it as the following:
alias nirdirs '`ls -ltr | grep "^d" | awk "{print \\$9}" | xargs du -hs`'
I've got the following error when I've run the alias:... (7 Replies)
Discussion started by: nir_s
7 Replies
4. OS X (Apple)
I have a file named 'aliases' which contains a list of aliases like:
alias loc='locate'
alias h='history'
alias .='pwd'
alias ..='cd ..'
alias cd..='cd .. ; pwd'
..............................
Where should I put this file (alias) so when Terminal launches .bash and thus a shell at... (1 Reply)
Discussion started by: shub22
1 Replies
5. UNIX for Dummies Questions & Answers
If one:
$ find -name 'some expression' -type f > newfile
and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory.
I am... (3 Replies)
Discussion started by: Alexander4444
3 Replies
6. Shell Programming and Scripting
I want to type only the filename of a gcc source that has ".syn" as an extension and copy it, changing the extension to ".c" so it can be compiled.
I do it as follows:
if (-e $1.syn) then
/bin/cp $1.syn $1.c
endif
This works fine, but if I want to repeat the compilation by... (1 Reply)
Discussion started by: ygmwayne
1 Replies
7. Shell Programming and Scripting
I want to create an alias as follows but is not working
alias ../='cd ../' (3 Replies)
Discussion started by: kristinu
3 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I want to create an alias for this command:
grep -i "<keyword_to_search>" <path_to_search>
Here's the alias I intended to make:
alias k 'set ARGS1 =(\!1); set ARGS2 =(\!2); grep -i "$ARGS1" ARGS2'
So that next time, for example, if I want to search the keyword "Help" in the path... (5 Replies)
Discussion started by: mar85
5 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Here is what I am supposed to do, word for word from my assignment page:
1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies
10. OS X (Apple)
Hi,
I'm using Mac 10.9.1. I would like to create an alias for grep so that it won't print out messages like "grep: /Users/davea/workspace/myproject/subdir/: Is a directory" all the time. So in my terminal, I opened ~/.profile and entered
alias grep='grep -s'
However, when I close and... (5 Replies)
Discussion started by: laredotornado
5 Replies
LEARN ABOUT REDHAT
symlink
SYMLINK(2) Linux Programmer's Manual SYMLINK(2)
NAME
symlink - make a new name for a file
SYNOPSIS
#include <unistd.h>
int symlink(const char *oldpath, const char *newpath);
DESCRIPTION
symlink creates a symbolic link named newpath which contains the string oldpath.
Symbolic links are interpreted at run-time as if the contents of the link had been substituted into the path being followed to find a file
or directory.
Symbolic links may contain .. path components, which (if used at the start of the link) refer to the parent directories of that in which
the link resides.
A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent one; the latter case is known as a dangling
link.
The permissions of a symbolic link are irrelevant; the ownership is ignored when following the link, but is checked when removal or renam-
ing of the link is requested and the link is in a directory with the sticky bit set.
If newpath exists it will not be overwritten.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EPERM The filesystem containing newpath does not support the creation of symbolic links.
EFAULT oldpath or newpath points outside your accessible address space.
EACCES Write access to the directory containing newpath is not allowed for the process's effective uid, or one of the directories in new-
path did not allow search (execute) permission.
ENAMETOOLONG
oldpath or newpath was too long.
ENOENT A directory component in newpath does not exist or is a dangling symbolic link, or oldpath is the empty string.
ENOTDIR
A component used as a directory in newpath is not, in fact, a directory.
ENOMEM Insufficient kernel memory was available.
EROFS newpath is on a read-only filesystem.
EEXIST newpath already exists.
ELOOP Too many symbolic links were encountered in resolving newpath.
ENOSPC The device containing the file has no room for the new directory entry.
EIO An I/O error occurred.
NOTES
No checking of oldpath is done.
Deleting the name referred to by a symlink will actually delete the file (unless it also has other hard links). If this behaviour is not
desired, use link.
CONFORMING TO
SVr4, SVID, POSIX, BSD 4.3. SVr4 documents additional error codes SVr4, SVID, BSD 4.3, X/OPEN. SVr4 documents additional error codes
EDQUOT and ENOSYS. See open(2) re multiple files with the same name, and NFS.
SEE ALSO
readlink(2), link(2), unlink(2), rename(2), open(2), lstat(2), ln(1)
Linux 2.0.30 1997-08-21 SYMLINK(2)