The utilities that we will be working with are ‘ tar‘ (The GNU version of the tar archiving utility) and ‘ gzip‘ (Compress or expand files). In this section of the article we will look at how to compress files and directories. However, if you run the ‘ stat‘ command against the soft symbolic link we created earlier you will notice that the inodes differ. Size: 15008 Blocks: 32 IO Block: 4096 regular fileĪccess: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)įigure 2.4: Checking the original and hard symbolic link thoroughly.Īs you can see in Figure 2.4 the inodes are identical. Figure 2.4 shows the ‘ stat‘ command being executed which allows you to examine a file more thoroughly. This is because hard links point directly to inodes and not the filename. rwxr-xr-x 2 root root 15008 00:56 /usr/calįigure 2.3: Creating a hard symbolic link of the ‘cal’ utility.Īs you can see in Figure 2.3 the hard link was successfully created and it does not show a pointing arrow when issuing the ‘ ls -l‘ command. The second example that we will look at is creating a hard symbolic link to the ‘ cal‘ utility, Figure 2.3 shows the command used to create the hard symbolic link. Lrwxrwxrwx 1 root root 12 18:25 /root/cal -> /usr/bin/calįigure 2.2: Creating a soft symbolic link to the ‘cal’ utility.Īs you can see from Figure 2.2 the ‘ cal‘ utility was successfully created and ‘ls -l’ shows that the /root/cal file points to the /usr/bin/cal file. Linux-9sl8:~ # ln -s /usr/bin/cal /root/cal Figure 2.2 shows the command used to create the soft symbolic link. The first example creates a soft symbolic link for the ‘ cal‘ utility which is stored within the /usr/bin directory. Figure 2.1 shows the syntax of create a symbolic link.Īs you can see in Figure 2.1 the first argument is the actual filename you would like to point to and the second argument is where you want the symbolic link (shortcut) to be. However, if you want to create soft links you need to provide the -s qualifier. This command with no qualifiers and two arguments will create a hard link. The command that you use to create symbolic links is ‘ ln‘. However, you can create soft links across multiple devices. If you have created separate partitions for /home and /usr you cannot hard link any files from /usr to /home. You cannot create hard links across multiple devices e.g.
0 Comments
Leave a Reply. |