Score:0

Can I reference a file in another file location rather than copying and pasting it?

ms flag

Imagine I have a file named "Movie 1" sized 2 gb in the Videos directory, and then i want to organize that file into 2 other files, such as placing "Movie 1" into "Funny Movies" file and "Action Movies" File. Normally i would copy the "movie 1" and paste it into both "funny movies" and "action movies", but wouldn't it use 4gb memory for the same "Movie 1" which is double to its original size of 2gb. Is there someway to refer the file located in videos and refer to it as many times i want instead of making copies and occuping more and more memory of making copies of the same file.

I just started using ubuntu 20.04 as my primary OS.

*Sorry if the question is a little confusing to understand.

HuHa avatar
es flag
Use symbolic links. https://en.wikipedia.org/wiki/Symbolic_link
Score:0
cn flag

This is what links in Linux allow to do. Using links, you can refer to the same data from within different folders.

Linux knows hard links and symbolic links. For practical purposes, you can use symbolic links, which work also across partitions.

Your file manager allows to create symbolic links in different ways.

  • Mouse: Hold ctrl+Shift pressed and drag a file or folder. You see that the cursor adopted a specific shape, hinting you that you will create a link when releasing the mouse button.
  • Keyboard - 1: Press Ctrl+c as you usually would do to copy a selected file or folder. When in the destination folder, hit Ctrl+m to create a symbolic link to the copied item.
  • Keyboard - 2: Select one or more files and folders. Hit Ctrl+Shift+m to create links to all selected items in the same folder. You can then move these links to their final location.
  • Right-click menu: You can include a "Create Link" option in the right-click menu by enabling this in the Preferences.

Hard links are not exposed in the user interface. They allow to create file entries in different folders that are in no way distinguishable from the original file: you cannot tell which one is the link and which one is the original - both entries are fully equivalent. Such links, however, only work within the same file system (partition).

Syed Ibrahim Bukhari avatar
ms flag
Thanks man, It worked.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.