N
N
Nikname_non_name2019-08-27 21:59:22
linux
Nikname_non_name, 2019-08-27 21:59:22

Virtual folders in Linux is it possible?

Hello!
There is a user folder (for example, Ivan). Is it possible to create a folder, the content of which will be equal to the content of another folder (/usr/local), while the folder is physical (not a windows shortcut). However, this folder can be accessed via sftp (scp) (if configured). Is this possible, and if so, how to create such a folder?!
Thanks in advance for your replies!!!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander Shokhrov, 2019-08-27
@KodyWiremane

If sftp to /usr/local is not an option, from what I know I can suggest mount --bind.
A normal, empty folder is created in the home folder: mkdir /home/ivan/usr-local
If you now do this from root , then the contents of the first folder will be displayed in the second folder. Cancel the spell, respectively, . By mana, instead of manual commands, you can write in , which will lead to a similar effect automatically. mount --bind /usr/local /home/ivan/usr-local

R
Ronald McDonald, 2019-08-27
@Zoominger

the contents of which will be equal to the contents of another folder (/usr/local), while the folder is as a physical one (not a windows shortcut).

Okay, Google, hard links on Linux.
In principle, yes, but it is better not to do so.

T
Talyan, 2019-08-27
@flapflapjack

man ln
but if you don't like to read mana, like me, then google what comrade Ronald wrote to you

S
Saboteur, 2019-08-28
@saboteur_kiev

Symbolic links will suffice for your task.
are done by the ln command with the -s
man ln option

C
CityCat4, 2019-08-28
@CityCat4

Not safe. Well, it's just extremely unsafe. This trick ears you sorry, why? Because /usr/local is in PATH? Add what you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question