Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        4年前关闭。
                                                                                            
                
        
我有两个文件夹/ tmp / logs和/ home / tmp /

/ tmp / logs中已有50个文件。
我想将所有文件都移动到/ home / tmp,并且还要在/ tmp / logs中创建新文件时将其创建到/ home / tmp。
因此,/ tmp / logs仅作为文件夹存在,但在其中没有任何创建。

最佳答案

#move /tmp/logs to their new location
mv /tmp/logs /home/tmp

#replace the original /tmp/logs with a link to /home/tmp
ln -s /home/tmp /tmp/logs


现在,只要程序要求内核在/tmp/logs中完成任何操作,内核就会看到它是一个符号链接,而将作用于/home/tmp中的相应文件(链接指向的是)。

关于linux - Linux链接文件夹,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32869333/

10-14 16:09
查看更多