How to symlink a directory in Linux?
Step 1: To symlink a directory, first, we need to create a directory using the mkdir command.
mkdir gfg
Step 2: We create a soft link to the directory using the ln -s command
ln -s gfg symgfg
Step 3: We can easily access the link directory
ls -la | grep "symgfg"
How to Symlink a File in Linux
In Linux/UNIX, a symbolic link or soft link, also referred to as a symlink, is a useful tool for linking files or directories from different locations. Similar to a pointer in C programming, a symlink directs to the original file from an alternate location. The creation of symbolic links is facilitated by the ln command. However, it is important to note that a symlink will only function if the original file exists on the system. If the original file is accidentally deleted, the symlink file becomes unusable.