分页: 1 / 1

问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 16:30
meoow
只知道%f 是带路径文件名

%d是文件所在路径

%n是不带路径的文件名

问一下%n的文件名带不带后缀?如果是带后缀的话那么不带后缀的是什么符号?

%p为工作路径是不是指执行程序所在路径?

%u是什么意思?

还有没有其他的这种类型的符号希望高人给介绍一下,如果更能给个详尽教程的链接那就再好不过了。


最后再问一下这种格式的符号叫什么?


谢谢

PS.假设如果想把某个文件夹内的*.1234这个后缀的文件批量的的重命名为*.321,那么终端下语句该怎么写?

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 16:42
heke2929
顶一下,我也有疑问……

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 18:03
meoow
貌似我问的应该是很基础的问题,难道没人知道

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 18:34
BigSnake.NET
看不懂你说什么东西

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 19:27
jiangpeng
$ for i in `ls -1`; do mv $i "${i%.1234}.321"; done

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 19:36
cheeselee
rename 's/\.1234$/.321/' *

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-02 21:09
cheron
这些特殊字符的定义,俺在找launcher的资料时到过的,当时想做一个简单的launcher解决vmware的keycode问题
ubuntu自己的help里就有,里面有个链接 指向这里内容更详细 http://standards.freedesktop.org/deskto ... 0.9.4.html
官方文档里也有 https://help.ubuntu.com/7.04/user-guide ... chers.html
俺记得help.ubuntu.com里有很多有用的资料,学ubuntu应该多经常去看看

代码: 全选

Recognized fields are as follows:

%f	A single file name, even if multiple files are selected. The system reading the desktop entry should recognize that the program in question cannot handle multiple file arguments, and it should should probably spawn and execute multiple copies of a program for each selected file if the program is not able to handle additional file arguments. If files are not on the local file system (i.e. are on HTTP or FTP locations), the files will be copied to the local file system and %f will be expanded to point at the temporary file. Used for programs that do not understand the URL syntax.

%F	A list of files. Use for apps that can open several local files at once.

%u	A single URL.

%U	A list of URLs.

%d	Directory containing the file that would be passed in a %f field.

%D	List of directories containing the files that would be passed in to a %F field.

%n	A single filename (without path).

%N	A list of filenames (without paths).

%i	The Icon field of the desktop entry expanded as two parameters, first --icon and then the contents of the Icon field. Should not expand as any parameters if the Icon field is empty or missing.

%c	The translated Name field associated with the desktop entry.

%k	The location of the desktop file as either a URI (if for example gotten from the vfolder system) or a local filename or empty if no location is known.

%v	The name of the Device entry in the desktop file.

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-03 0:20
allarem
感觉LZ在说amule……

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-03 9:21
eexpress
说nautilus? 如果是,开那script目录,就有提示的。


语意混乱啊。难怪球猫晕了。

Re: 问一下 %f、 %n、 %d等符号的含义

发表于 : 2009-07-03 12:50
meoow
谢谢ls几位的解答