creating a symlink [symbolic link]

Creating a symlink [symbolic link, known as a shortcut to Windows users] using the command line. To create a symlink to a file called test_file in /home/martin on the desktop we open a [Terminal] and because it defaults to the home directory create the test file test_file with;

touch test_file

and add some text to it with

echo “This is a test file” > test_file

now we create the link with

ln -s /home/martin/test_file ~/Desktop

this will create a symbolic link to the file on you desktop, open the file using it and you should see the text we added above. Note the ~/ option is a shortcut of /home/martin i.e. to your home folder. Now lets create the symlink again with a different name

ln -s ~/test_file ~/Desktop/”My Test File”

The same command can be used to create symlinks to Directories and symlinks can be removed with rm -f, so our last symlink can be removed with;

rm -f ~/Desktop/”My Test File”

Using Ubuntu Jaunty on the Gnome Desktop


Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: