Hi
Sorry for being a bit thick here but I'm a little confused by Symlinks.
I want to transfer all files and directories from one directory to another, which way is it done?
1. ln -s /home/pi/mnt1/FrontGates ~ /home/pi/mnt2/4TBHDD/FrontGates.sh
OR
2. ln -s /home/pi/mnt2/4TBHDD /FrontGates/ ~ /FrontGates.sh
I've spent hours reading through 'sysmlink' stuff but none I've found are clear about which file/folder is being moved where?
I would like the files/folders in mnt1 to be moved to mnt2 so mnt1 does not fill up with files/folders, can anyone tell me how please?
Symlinks don't transfer anything they just make something visible on two different paths without copying them. They're functionally the same as windows shortcuts (but much older).
Next, neither of those commands will work:
- ln -s needs two arguments (a source and a destination). Your commands have three.
- ~ is part of the path and must not have a space between it and the following "/".
- ~ is expanded to your user's home directory (in this case /home/pi) either use ~ or the full path of the home directory. That means the destination in your first command becomes /home/pi/home/pi/mnt2/4TBHDD/FrontGates.sh which probably doesn't exist.
- You appear to be trying to link a directory to a shell script. What you'll end up with is a symlink named as a shell script. Which is confusing.
- If /home/pi/mnt2/4TBHDD/FrontGates.sh exists at best the command will fail. At worst it will replace the existing shell script with a symlink and the shell script will be lost.
Statistics: Posted by thagrol — Sun Aug 10, 2025 2:02 pm