问题标签 [ln]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
12627 浏览

bash - 递归符号链接目录树

我正在尝试将递归符号链接从一个目录运行到另一个目录:

再加上一个:我需要去掉data/前缀。

在 OS X 服务器(10.8,Mountain Lion)上运行——并非所有标准 GNU 命令(如cp -rs)都受支持。

我的意思是递归:

data是 Laravel 版本之间的持久目录列表:

他们需要映射到:

我们的data目录将是应用程序启动之间的持久存储,因为我们更新我们的站点,同时在回滚的情况下保留站点的先前版本(current恰好是最新版本的软链接)。

注意:除了 Laravel,我们还有其他网站。data将成为我们的标准,我们将根据站点对持久性的要求来匹配目录重组。不会总是这样data/storage

0 投票
1 回答
2354 浏览

linux - Linux 硬链接 (ln) 和 GIT

我有一个指向 git 文件的 linux 硬链接 (ln)。任何人都知道如果我在 git 中更新文件会发生什么?我必须再次进行硬链接吗?

0 投票
2 回答
204 浏览

c++ - using system() to call ln from a cpp program

I am trying to call system from a cpp program with the following command

Both targetDir and baseDir are QStringList. The program compiles and runs but when I execute the command i get the error ln : targetDir[0] is an invalid command. When I test by hard coding the values instead of using variables it works just fine. I can only conclude it is not escaping the string to put the value of the variables int the argument passed to ln. For the life of me I can't figure out why not.

Any Ideas?

0 投票
3 回答
104 浏览

r - 许多公司的对数回报计算r

我有一个这样的文件。

想用这个公式 ln(current price/previous price) 计算对数回报,我的预期输出是这样的

试图通过此代码从先前的堆栈溢出答案中解决但失败

0 投票
0 回答
52 浏览

unix - 带有目标目录的符号链接二进制文件

我有一个二进制文件,它使用亲戚路径加载资产,我想在 /usr/bin 中放置一个链接。

我试过了ln -s ~/game_directory/game /usr/bin/game

它启动我的二进制文件但无法加载我的资产,因为它显然没有找到文件夹 ./assets 。

有什么解决办法吗?

0 投票
1 回答
22 浏览

linux - 应用程序进行中的符号链接生命周期

我想知道符号链接的生命周期。例如:我有目录:

我制作符号链接:

然后我会编译它:

在此操作的进行中,我会将符号链接更改为其他类似目录:

符号链接会保存在“make”程序的上下文中还是会被热替换?

0 投票
0 回答
66 浏览

symlink - 如何快速判断文件是否在链接的目录中?

当我在 IPython 笔记本中工作时,我有时会这样做!pwd,当然它会显示我正在工作的目录。但有时这些文件位于链接的目录中。

例如,当我这样做时,!pwd我会看到/a/b/c/,当使用find命令实际找到这个文件时,我看到它位于/a/d/e/file_name.ipynb.

但是当我点击链接时,我看到了/a/b/c/ -> /a/d/e/. 令人讨厌的是,我不知道它连接的路径在哪里。它可能是/a/b/ -> /a/d/什么。

当我找出文件存在的位置时,如何找出它链接的路径?

谢谢。

0 投票
1 回答
229 浏览

bash - 从某个文件夹中的递归搜索创建符号链接

我想为递归搜索创建符号链接。find这也适用于包含空格的文件夹。

符号链接应该在某个文件夹中创建。

我尝试使用这个脚本:

问题是文件的完整路径没有传递给ln,所以创建的链接都被破坏了。

0 投票
0 回答
478 浏览

windows - Symbolic link to easily access folders on cloud storage return broken links of folders

As I'm now using ubuntu, I've created a symbolic link to access my cloud storage files, saved on NTSF format in my former windows operational system. So I've created this simple .sh document to address this files directly to my desktop every time I want to use them. It just suddenly stopped working. I don't know what it is. Any clue?

When I execute this code in the terminal, typping ./clouds.sh, it should create three folders on my desktop, with symbolic links to my cloud storage folders, as it was doing. It now creates three broken links. Sometime the script works, sometimes it just doesn't work and I can not identify what is causing this behavior.

Sorry for the naive question. I'm only starting with coding.

Thanks

0 投票
2 回答
149 浏览

bash - 删除目录(树)中的所有链接(别名)

我有一个目录,其中可能包含也可能不包含文件、其他目录或链接。

我想删除所有链接。任何人都知道可以让我快速执行此操作的 bash 脚本吗?