symlink

How to find files excluding symbolic links?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 06:27:51
问题 I want to find files in Linux that follow a certain pattern but I am not interested in symbolic links. There doesn't seem to be an option to the find command for that. How shall I do ? 回答1: Check the man page again ;) It's: find /path/to/files -type f type f searches for regular files only - excluding symbolic links. 回答2: ! -type l For example, if you want to search all regular files in /usr/bin, excluding symlink: find /usr/bin/ \! -type l 回答3: Do you want it to follow symlinks but not

listFiles() of File not working on symbolic links?

天大地大妈咪最大 提交于 2019-12-03 06:11:54
I have the following File object pointing to a directory via symbolic link, File directory = new File("/path/symlink/foo/bar"); String[] files = directory.listFiles(); listFiles() returns null, is this because of the symlink? if yes, how will I go about this if I really want to list the files in bar using the path that contains a symlink? According to what I've seen while Googling this puzzling behavior, Java requires that you call .getCanonicalFile() on a File whose path contains a link before you can use it in other file operations. So: File directory = new File("/path/symlink/foo/bar")

PHP opcache reset + symlink-style deployment

懵懂的女人 提交于 2019-12-03 05:49:24
问题 I am trying to reset PHP opcache after a symlink-style deployment. There is the opcache_reset.php file in my project which is executing by wget after the document root's symlink replacement: <?php clearstatcache(true); opcache_reset(); In spite of that, the old files are still used. According to opcache_get_status() output, the number of manual_restarts increases, last_restart_time keeps up-to-date, but the file paths remains outdated. I need to call opcache_reset.php manually after a minute

NTFS Junctions vs. Symbolic Links (for directories) [closed]

纵饮孤独 提交于 2019-12-03 05:02:49
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. From a high-level standpoint (meaning only worrying about the results and the interface, not the implementation), what is the difference in behavior, if any, between an NTFS reparse point that points to a directory and a symbolic link that points to the same directory? Are they resolved at the same level in the stack, or is it possible for one to be unresolvable at a certain time when the other one can be resolved (e.g.

Resolve symbolic links when copying bundle resources in Xcode

杀马特。学长 韩版系。学妹 提交于 2019-12-03 05:01:18
问题 I have a project in Xcode and some resources for the project. The resources contain several symbolic links. When Xcode builds the project, it copies the resources, but does not resolve the symbolic links. Is there a way to tell Xcode to resolve the links? (Ie. have the link targets copied instead of the links themselves.) Update: Thanks, mouviciel, that was almost it. At first I tried to do it using the Copy Files phase, but the pbxcp program called by this phase did not resolve the links

How do I move a relative symbolic link?

左心房为你撑大大i 提交于 2019-12-03 04:25:59
I have a lot of relative symbolic links that I want to move to another directory. How can I move symbolic links (those with a relative path) while preserving the right path? You can turn relative paths into full paths using readlink -f foo . So you would do something like: ln -s $(readlink -f $origlink) $newlink rm $origlink EDIT: I noticed that you wish to keep the paths relative. In this case, after you move the link, you can use symlinks -c to convert the absolute paths back into relative paths. daxim This is a perl solution that preserves relative paths: use strictures; use File::Copy qw

Virtualenv not creating an environment

我是研究僧i 提交于 2019-12-03 04:24:56
问题 I installed Virtualenv on Ubuntu 12.04 and was using it to work on a sample project under the unity desktop. I'm using VirtualBox and was having some issues with the unity desktop so changed to the KDE desktop. I'm now trying to create a new project but the virtualenv won't allow me to create a new environment in my project folder. In the terminal I navigate to the project folder, type virtualenv venv and get the following error messages: Traceback (most recent call last): File "/usr/bin

MAC OSX El Capitan: Airport Sym link not permitted

心已入冬 提交于 2019-12-03 04:18:57
问题 I tried making a symbolic link to the airport command in MAC OS X El Capitan, using the command: sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport It returned the following error: ln: /usr/sbin/airport: Operation not permitted Is this due to the El Capitan's "rootless" feature? The sym link worked fine in MAC OS X Yosemite. 回答1: The target directory should be /usr/local/bin/airport See the article on System Integrity

Nginx sites-enabled, sites-available: Cannot create soft-link between config files in Ubuntu 12.04

只愿长相守 提交于 2019-12-03 01:36:11
问题 I am trying to create soft links between config files containing server blocks in the sites-enabled and sites-available directories in /etc/nginx/. The command I am using is: sudo ln -s sites-available/foo.conf sites-enabled/ When I then execute: ls -l The result is: lrwxrwxrwx 1 parallels parallels 27 Aug 6 20:44 immigrationinformation.conf -> immigrationinformation.conf where the immigrationinformation.conf -> immigrationinformation.conf part has a charcoal with red typeface. When I then

Is there a way to edit a symlink without deleting it first? [duplicate]

。_饼干妹妹 提交于 2019-12-03 01:35:57
问题 This question already has answers here : Can you change what a symlink points to after it is created? (7 answers) Closed last year . So I created a symlink: ln -s /location/to/link linkname Now I want to change the location that the symlink links to. How do I do that? is there a way to do it without deleting it first? 回答1: You could create the new link with a different name, then move it to replace the old link. ln -s /location/to/link linkname Later ln -s /location/to/link2 newlink mv