1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

シンボリックの備忘録

Last updated at Posted at 2020-06-05

#シンボリックリンク

##コマンドの使用方法
リンクを貼りたいディレクトリに移動し、相対パスor絶対パスで参照先ファイルを記述し、貼り付け先./もしくは./ファイル名を記述する。
オプションとして-sfを指定してやる。

###使用例
hoge/b.txtをカレントディレクトリにa.txtという名前でリンクを貼りたい

$ln -sf  ../../hoge/b.txt  ./a.txt

リンクを削除したいなら次にようにコマンドを打つ。

$unlink a.txt
rm a.txt

でも可だが非推奨。

⁂リンクの参照先はファイルでもディレクトリでも可能。
ディレクトリごとリンクをはった場合は、貼ったリンクの直下は実物のファイルなので注意!

#シンボリッリンクのコピー

##リンク元をさかのぼってコピーする

rsync -avz -–copy-links  ./hoge1   ./hoge2

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?