Creating Alias for FILE

Hello,

I need the command to create alias for a file "FILE" (NOT for commands) ? And Is there any difference between creating alias for files and creating alias for commands ?

For info, i'm using Solaris 8

Thx,

you mean, that if you`ll run

$ cat file_alias

you`ll expect that it will show the content of file, that you`re referring to as file_alias?

you should take a look at

ln -s file alias_to_file

it will create symlink you could refer to

Thx for ur reply but let me be more precise.

I have some files : file1, file2, file3, ... fileN in /origin directory. I need to create alias in /tmp directory : alias_file1, alias_file2, ... alias_fileN for all of those existing files.

An other application will fetch on /tmp directory for those existing alias then it will copy the corresponding file from /origin.

i.e : if the application will find alias_file1 created on/tmp, it will copy the file1 from /origin.

I don't care about how this application will check the alias. But i need only to create the alias for those files.

I can not use the symbolic link because later in our process of managment, we have to delete some alias without affecting the origin files. Because I think if we delete symbolic link the corresponding file will be affected !!!

P.S : I need to create the alias because the origin files are so sensitive and not advised to be managed directely.

Thx again,

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.

Thanks,

I'm still having one question plz :

Does it exist this notion of alias for files like for commands ? In other words, can we create alias for file like for we used to do for command with the famous command :

alias command=cmd ? But for file instead of command ?

Thx,

dont forget, that you have to provide path to the file, so symlinks will do the job for you.

also, i dont think that there is an non-tricky and 100% always working way to do such "aliasing" you want implement.

regards,
nik