今日からあなたもLinuxシステム管理者lnファイル、ディレクトリへのリンクを作成する。特に必要がない限り-sオプションを指定してシンボリックリンクを作成する。2つ指定するファイル名(ディレクトリ名)のうち最初が実在するファイル名(ディレクトリ名)、2つ目が作成するリンクの名前である。例えば"/usr/local/tomcat"ディレクトリへのシンボリックリンクを作成するには以下のようにlnコマンドを実行すれば良い。[mobile@localhost mobile]$ ln -s /usr/local/tomcat tomcat本当にリンクが作成されたかどうかはlsコマンドで確認できる。 [mobile@localhost mobile]$ ls -la 合計 13064 drwx------ 5 mobile mobile 4096 11月 24 01:37 . drwxr-xr-x 3 root root 4096 7月 27 22:18 .. -rw------- 1 mobile mobile 9882 11月 24 00:51 .bash_history -rw-r--r-- 1 mobile mobile 24 7月 27 22:18 .bash_logout -rw-r--r-- 1 mobile mobile 398 8月 2 14:35 .bash_profile -rw-r--r-- 1 mobile mobile 124 7月 27 22:18 .bashrc -rw-r--r-- 1 mobile mobile 5531 7月 27 22:18 .canna lrwxrwxrwx 1 mobile mobile 17 8月 6 09:12 tomcat -> /usr/local/tomcat
Copyright(C) 2004-2015 モバイル開発系(K) All rights reserved.
[Home]
|