From the course: Linux CentOS 7: Files and Permissions

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Create links to files and dirs

Create links to files and dirs - Linux Tutorial

From the course: Linux CentOS 7: Files and Permissions

Start my 1-month free trial

Create links to files and dirs

- [Instructor] When organizing our work space, it can be advantageous to create links, or shortcuts, to our files and directories. For instance, we can have a link in our home directory called Netdrive that points to a network drive that's at /media/network/server/bob/files. This saves time browsing to it as it's a shortcut in our home directory. There are two different kinds of links: symbolic links, and hard links. We'll start out by creating hard links. In a terminal, let's create a directory for this exercise. Type in mkdir lnexercise and hit enter. Then cd lnexercise and hit enter again. You can verify your path by typing in pwd. Now let's create a file and a directory. Type in touch file.txt and hit enter. And then create a directory by typing in mkdir dir1. We can verify this with ls -l. We can see that we have a file named file.txt, and a directory named dir1. Now let's create a hard link to file.txt and we'll name that hard link file link.txt. The syntax is ln file.txt…

Contents