シンボリックリンクを作る。
リンクとは、ファイルやディレクトリを移動したりコピーしたりせずとも、違うファイル・ディレクトリのように扱える機能です。
シンボリックリンク:
元ファイルのパスを指し示す擬似的なファイルを作成。
元ファイルを消すとエラー。
$ ln -s ファイル名 リンク名
ハードリンク:
元ファイルを直接指す。
元ファイルを削除してもOK。
$ ln ファイル名 リンク名
削除
$ rm リンク名
$ touch test $ ls -la -rw-r--r-- 1 A_01 staff 0 12 21 00:29 test $ ln -s touch symbolic_link $ ls -la lrwxr-xr-x 1 A_01 staff 4 12 21 00:29 symbolic_link -> test←頭にlと付くのか! -rw-r--r-- 1 A_01 staff 0 12 21 00:29 test $ ln test hart_link $ ls -la lrwxr-xr-x 1 A_01 staff 4 12 21 00:29 symbolic_link -> test -rw-r--r-- 1 A_01 staff 0 12 21 00:29 test -rw-r--r-- 2 A_01 staff 4 12 21 00:35 hard_link $ vim test aaa $ cat symbolic_link aaa $ cat hard_link aaa $ rm test $ cat hard_link aaa $ cat symbolic_link cat: symbolic_link: No such file or directory
参考
http://www.linux-beginner.com/linux_kihon129.html
http://itpro.nikkeibp.co.jp/article/COLUMN/20060227/230812/
http://trialpc.net/blog/2007/09/post-986.php