Stop wasting space with Copy and Paste

A better way to copy and paste without wasting space on disk.

Krishna Kotni
2 min readSep 6, 2021
An image of copy paste shortcut keys
Publised by TechRadar

What is this about?

Copying a file or folder consumes a lot of space on the disk, learn to create a copy of folder that can reflect changes and Save space.

Linking

Contents in a file is stored in the form of inode on the disk. File name is just a link pointing to the inode. When you copy a file or folder to a different location a duplicate inode is created and the file name is linked to the new inode. If this is the process, think about what if we have the same inode and just make different file paths point to the same inode. This process is known as hard linking.

This will result to save space and the changes to the inode, will reflect to all links(As they point to the inode itself).

$ln <source file path> <destination path>
An Image demonstrating how symbolic and hard link are connected to files structure
Published on StackOverflow

Symbolic Link

It is similar to hard link, this creates a link to the file instead of a link to the inode, You may ask what is the difference. This is more of like a shortcut to the file rather than a link to the actual inode in the disk, the extra feature we get with this is we can create Symbolic links for folder which is not possible for hard links.

$ln -s <source file/folder path> <destination path>

Usage

  • System .dotfiles like .bash_profile, .bashrc, .zsh are difficult to find, now you can link all the files to a folder and when you want to change to a new system you can easily transfer all your configuration files.
  • Arranging files in folder, you may have different folder which should have same files like eg: Github folder and Collage folder may have same project files, then you can simply link them.

Check Out my other Blogs: Blogs📕

--

--