Create a symbolic link to a log file.
ln -s /var/log/app.log app.logCreate a link. Use -s to create a symbolic link.
ln [OPTION]... TARGET [LINK_NAME]Create a symbolic link to a log file.
ln -s /var/log/app.log app.logCreate a hard link on the same filesystem.
ln source.dat source-hardlink.dat| Option / clause | Description |
|---|---|
-s, --symbolic | Create a symbolic link instead of a hard link. |
-f, --force | Remove an existing destination link before creating the new one. |
-i, --interactive | Prompt before removing an existing destination. |
-n, --no-dereference | Treat a destination symlink to a directory as a normal file. |
-T, --no-target-directory | Always treat LINK_NAME as the link name, not a directory. |
-v, --verbose | Print the name of each created link. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.