Monday, September 19, 2011

Linking Files


You can use the link command to create a pointer to an existing file. When you do this, you aren’t
actually creating a new file as such; you are creating a virtual copy of the original by pointing a new
filename to an existing file.

$ ln –s <current_filename> <link_name>


The following command creates a symbolic link called test.sql, which refers to the original file
called monitor.sql:

$ ln -s /u01/app/oracle/admin/dba/sql/monitor.sql      /u01/app/oracle/bilal_test.sql


Once bilal_test.sql
 symbolic link is created, the status of the new file can be checked from the 
/u01/app/oracle directory, as shown here:
$ cd /u01/app/oracle
$ ls -altr bilal_test.sql
lrwxr-xr-x   1 oracle     dba             41 Mar 30 10:13 bilal_test.sql -> /u01/app/oracle/
admin/dba/sql/monitor.sql
$


No comments:

Post a Comment