To create a symbolic link in Linux, you can use the ln
command with the -s
option, followed by the target file and the link name. For example:
ln -s /path/to/target /path/to/link
This will create a symbolic link at /path/to/link
that points to /path/to/target
.
You can also use the -t
option to specify the directory where you want to create the link. For example:
ln -s /path/to/target -t /path/to/directory
This will create a symbolic link in /path/to/directory
that points to /path/to/target
.
By default, ln
will create a hard link, so be sure to include the -s
option to create a symbolic link instead.
You can also use the ln
command with the -f
option to force the creation of the link, even if a file with the same name already exists.
ln -sf /path/to/target /path/to/link
This will create a symbolic link at /path/to/link
that points to /path/to/target
, replacing any existing file with the same name.
For more information, you can consult the ln
man page by running man ln
on the command line.