1,512   Linux

Linux命令ln -s

建立软连接,方便多处引用同一文件,省空间,便于整体修改

ln -s 源文件 目标文件
ubuntu@ip-172-31-18-250:/etc/apache2/sites-enabled$ sudo ln -s ../sites-available/luckybird.me.conf luckybird.me.conf

用ls -l 查看即可看到连接路径

ubuntu@ip-172-31-18-250:/etc/apache2/sites-enabled$ ls -l
total 0
lrwxrwxrwx 1 root root 35 Jun 10 16:38 000-default.conf -> ../sites-available/000-default.conf
lrwxrwxrwx 1 root root 36 Jun 13 15:49 luckybird.me.conf -> ../sites-available/luckybird.me.conf
lrwxrwxrwx 1 root root 40 Jun 10 16:36 www.luckybird.me.conf -> ../sites-available/www.luckybird.me.conf



Leave a Reply

Your email address will not be published. Required fields are marked *