linux - 将文件从一个文件夹投影到另一个文件夹

标签 linux file debian directory


我想在我的本地文件夹中有一部分 apache 配置。

有必要自动创建子域。

是否可以将本地文件夹中的所有文件投影到 Debian linux 下的 /etc/apche2/sites-available/ 文件夹中?

我。 e.不要为每个新文件创建符号链接(symbolic link),而只是让事情变得简单 8-)

它必须看起来像这样:

LOCAL FOLDER                           SITES-AVAILABLE

f1.conf                                s-a1.conf
f2.conf                                s-a2.conf
f3.conf                                s-a3.conf
                                       f1.conf
                                       f2.conf
                                       f3.conf

提前致谢!

最佳答案

来自 man mount:

mount --bind olddir newdir

After this call the same contents are accessible in two places. One can also remount a single file (on a single file).

在您的情况下,它将是:

sudo mount --bind /etc/apche2/sites-available/ ~/my/local/folder/

确保 ~/my/local/folder/ 在你执行 mount 之前是空的。

关于linux - 将文件从一个文件夹投影到另一个文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30017117/

相关文章:

node.js - 在 debian 上 npm install homebridge 期间 npm 失败(gyp 错误和安装脚本错误)

Python scrapy+selenium scraper docker build 报错(错误码100)

linux - 卸载 proc 文件系统

linux - Nginx 无法在 755 权限文件夹中创建文件

file - Unicode解码错误: invalid continuation byte when trying to read in document

python - 在python中重新读取csv文件而不再次加载它

php - 使用 PHP 在 Linux Debian 中合并 MP3 文件

linux - 如何在FTP中输入变量

php - 如何在php中使文件下载仅将文件路径保存在数据库中

linux - session 屏幕 - 如何获取 session 列表