Working with Links, Archives, and Compression

223
  1. Links
    • Create a file named file1.txt and write some text in it.
    • Create a hard link to file1.txt named hardlink1. Use ls -i to confirm they share the same inode number.
    • Modify hardlink1 and observe the changes in file1.txt.
    • Create a symbolic link to file1.txt named symlink1.
    • Delete file1.txt and try to access hardlink1 and symlink1. What’s the difference?
  2. Absolute and Relative Filenames
    • Navigate to your home directory. Using relative paths, navigate to /etc directory.
    • Navigate back to your home directory using an absolute path.
  3. Inodes
    • Create a new file, check its inode number using ls -i.
    • Create a hard link to this file and verify they share the same inode number.
  4. Archives and Compression
    • Create a new directory, add a few text files to it.
    • Create a tar archive of this directory.
    • Extract the tar archive in a different directory.
    • Compress one of the text files using gzip.
    • Decompress the gzip file.
    • Compress the same text file using bzip2.
    • Decompress the bzip2 file.
  5. Archiving and Compression Together
    • Create a compressed tar archive of the directory created earlier using gzip compression.
    • Extract the files from this compressed tar archive.
    • Repeat the steps using bzip2 compression.

Remember to replace the placeholder names with your own files and directories. Also, ensure you’re running these commands in a terminal.