Mac 下百度同步盘名字就这是这个,中文的,在 terminal 下不好操作,怎么改成英文的?

2014-11-03 11:04:03 +08:00
 thinker3
3878 次点击
所在节点    macOS
11 条回复
sneezry
2014-11-03 11:07:01 +08:00
别名?
thinker3
2014-11-03 11:16:13 +08:00
@sneezry 似乎可以,虽然看到那一串问号有点烦
caiych
2014-11-03 11:27:39 +08:00
function echo_and_go() {
echo $*
$*
}

alias baidu='echo_and_go ~/百度云同步盘'

可以直接 baidu 进入目录,也可以 `baidu`/sub_dir 进入子目录
我的rc里配了一堆这样的东西…
仅供参考…………
thinker3
2014-11-03 11:41:30 +08:00
@sneezry 我理解成 ln -sf,而不是alias
zjjhsyq
2014-11-03 12:13:02 +08:00
百度云不支持软链接到百度云同步盘的文件夹同步让我很蛋疼。。。
wudaown
2014-11-03 12:41:17 +08:00
分享神器chsdir...
https://code.google.com/p/easyscripts/wiki/chsdir
mac的解决方案我在哪里吗贴出来了
urmyfaith
2014-11-03 13:18:53 +08:00
3L,alias的命令似乎可以。我也试试,烦死中文名的处理了。
= =
learnshare
2014-11-03 13:33:25 +08:00
我想起了 Android 设置系统语言为 English,没几个软件能换个哪怕只是个英文名的
JConlee
2014-11-03 13:50:23 +08:00
我直接给同步文件夹做了个“硬连接”,方便以后操作。因为很多软件(比如vim)不能读取中文文件夹下的配置文件。

下面是以前摘抄在evernote里的方法:

Snow Leopard can create hard links to directories as long as you follow Amit Singh's six rules:

1. The file system must be journaled HFS+.
2. The parent directories of the source and destination must be different.
3. The source’s parent must not be the root directory.
4. The destination must not be in the root directory.
5. The destination must not be a descendent of the source.
6. The destination must not have any ancestor that’s a directory hard link.

You can't do it directly in BASH then. However... I found an article here that discusses how to do it indirectly:http://www.mactech.com/articles/mactech/Vol.23/23.11/ExploringLeopardwithDTrace/index.html by compiling a simple little C program:

#include <unistd.h>#include <stdio.h>
int main(int argc, char *argv[]){
if (argc != 3) return 1;
int ret = link(argv[1], argv[2]);
if (ret != 0) perror("link");
return ret;}

...and build in Terminal.app with:
$ gcc -o hlink hlink.c -Wall

给文件夹 "你好" 创建硬链接 "B":
sudo ./hlink /Users/Biao/Desktop/你好 /Users/Biao/B

Here is the "hunlink.c" program:
#include <stdio.h>
int
main(int argc, char *argv[]){
if (argc != 2)
return 1;
int ret = unlink(argv[1]);
if (ret != 0)
perror("unlink");
return ret;}

gcc -o hunlink hunlink.c

删除文件夹 "你好" 的硬链接:
sudo ./hunlink /Users/Biao/B
hr6r
2014-11-04 12:05:05 +08:00
改这个文件 ~/Library/Application Support/百度云同步盘/587e*****/macosnetdisk.plist
thinker3
2014-11-04 13:02:43 +08:00
@hr6r 正解

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/143571

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX