当前位置: 移动技术网 > 科技>操作系统>Linux > linux命令行下文件名中有空格的处理方法

linux命令行下文件名中有空格的处理方法

2018年03月16日  | 移动技术网科技  | 我要评论

q:我在树莓派命令行模式下使用mplayer播放单首音乐,因为文件名中含有空格,提示不存在该文件,该如何解决?

[johnwick@raspberrypi~]$sudo mplayer me like yuh.mp3

mplayer2 2.0-728-g2c378c7-4+b1 (c) 2000-2017 mplayer team

cannot open file '/root/.mplayer/input.conf': no such file or directory

failed to open /root/.mplayer/input.conf.

cannot open file '/etc/mplayer/input.conf': no such file or directory

failed to open /etc/mplayer/input.conf.

playing me.

cannot open file 'me': no such file or directory

failed to open me.

playing like.

cannot open file 'like': no such file or directory

failed to open like.

playing yuh.mp3.

cannot open file 'yuh.mp3': no such file or directory

failed to open yuh.mp3.

a:mplayerh播放当前目录下单首歌曲的格式为: mplayer [文件名],显然系统认为 me like yuh.mp3 是三个独立文件

解决办法:①使用引号(英文输入法下)将文件名全部包含: mplayer "me like yuh.mp3"

方法②空格前使用连接符号"\"   : mplayer me\ like\ yuh.mp3     “\”告诉系统后面跟着的字符为原意,不是命令

参考:linux命令行下进入带空格的文件夹的方法

完毕。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网