
모든 문서가 다른 하드 디스크 드라이브에 있도록 심볼릭 링크를 만들려고 합니다. 심볼릭링크를 만드는 방법을 배우고 원하는 심볼릭링크를 만들어 보았습니다. 이것은 터미널에서 사용한 명령입니다.
ln -s /media/Schijf-2/Nel/Mijn Documenten/ ./home/nel/Documenten
그러나 다음과 같은 오류 메시지가 나타납니다.
ln: target '.home/username/Documenten' is not a directory
비슷한 질문을 찾았지만 내가 뭘 잘못했는지 이해할 수 없습니다.
https://askubuntu.com/questions/465493/how-can-i-symlink-my-home-folder-from-another-drive
내 /home/<user>/Documenten
디렉토리를 /media/Schijf-2/Nel/Mijn Documenten
.
어떻게 성공할 수 있나요?
답변1
명령에 몇 가지 문제가 있습니다. 당신은 달렸다
ln -s /media/Schijf-2/Nel/Mijn Documenten/ ./home/nel/Documenten
Documenten
이는 " 을(를) 가리키는 링크를 생성한다는 뜻입니다 /media/Schijf-2/Nel/Mijn Documenten/
. 공백 때문에 ln 명령이 주어졌으나 대상으로 Documenten
사용되지 않았습니다 ./home/nel/Documenten
. 이를 처리하는 방법 중 하나는 이름을 인용하는 것입니다(참조:여기자세한 내용은):
ln -s /media/Schijf-2/Nel/"Mijn Documenten"/ ./home/nel/Documenten
Documenten
다음 문제는 현재 디렉토리에 이미 호출된 파일(디렉토리가 아님)이 있다는 것입니다. 이것이 ln
불평하는 이유입니다.
$ ls
file.txt
$ ln -s /tmp/ ./file.txt/
ln: target ‘./file.txt/’ is not a directory: Not a directory
따라서 실제로 원하는 작업을 수행하려면 파일을 삭제하거나 이름을 바꿔야 합니다 Documenten
.
$ mv Documenten Documenten.old
그런 다음 다음 명령을 실행하여 링크를 만듭니다.
$ ln -s /media/Schijf-2/Nel/"Mijn Documenten"/ Documenten