{"id":9381,"date":"2021-01-07T18:37:17","date_gmt":"2021-01-07T23:37:17","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=9381"},"modified":"2021-12-04T06:20:55","modified_gmt":"2021-12-04T06:20:55","slug":"create-symbolic-link-file-directory","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/create-symbolic-link-file-directory\/","title":{"rendered":"How to Create Symbolic Link of File or Directory in Linux"},"content":{"rendered":"\n
A symbolic link in Linux<\/a> is a type of file in Linux that points to another file or a folder on your computer. Here we will show you how to create a symbolic link in Linux.<\/p>\n\n\n\n Use the ln command with the -s directive to create a soft link with the following syntax:<\/p>\n\n\n\n Here is an example implementing the above syntax:<\/p>\n\n\n\n Compare the inode numbers of the symbolic soft link and the original file:<\/p>\n\n\n\n The above is run without the -s<\/strong><\/em> directive.<\/p>\n\n\n\n Again let’s compare the inode numbers of the hard link and the original file:<\/p>\n\n\n\n That’s it for create symbolic link for now. Remember to follow this post to read more about the differences between a soft link and a hard link<\/a> in Linux.<\/p>\n","protected":false},"excerpt":{"rendered":" A symbolic link in Linux is a type of file in Linux that points to another file or a folder on your computer. Here we will show you how to…<\/p>\n","protected":false},"author":1,"featured_media":9382,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,16],"tags":[193,354,424,523,573],"yoast_head":"\nCreate Symbolic Link (Soft Link)<\/h2>\n\n\n\n
$ ln -s \/path\/to\/originalfile \/path\/to\/linkfile<\/code><\/pre>\n\n\n\n
$ ln -s \/var\/www\/html\/config.php \/home\/user\/config.php<\/code><\/pre>\n\n\n\n
$ ls -li \/var\/www\/html\/config.php \/home\/user\/config.php\n\n4089832 lrwxrwxrwx 1 root root 11 Jan 07 08:47 \/home\/user\/config.php -> \/var\/www\/html\/config.php\n5780987 -rw-r--r-- 1 root root 24 Aug 12 10:22 \/var\/www\/html\/config.php<\/code><\/pre>\n\n\n\n
Create Hard Link Example<\/h2>\n\n\n\n
$ ln \/var\/www\/html\/config.php \/home\/user\/config.php<\/code><\/pre>\n\n\n\n
$ ls -li \/var\/www\/html\/config.php \/home\/user\/config.php\n\n5780987 -rw-r--r-- 1 root root 24 Aug 12 10:22 \/home\/user\/config.php\n5780987 -rw-r--r-- 1 root root 24 Aug 12 10:22 \/var\/www\/html\/config.php<\/code><\/pre>\n\n\n\n