linux命令行下文件名中有空格的處理方法
Q:我在樹莓派命令行模式下使用mplayer播放單首音樂,因?yàn)槲募泻锌崭?,提示不存在該文件,該如何解決?
[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播放當(dāng)前目錄下單首歌曲的格式為: mplayer [文件名],顯然系統(tǒng)認(rèn)為 Me like yuh.mp3 是三個獨(dú)立文件
解決辦法:①使用引號(英文輸入法下)將文件名全部包含: mplayer "Me like yuh.mp3"
方法②空格前使用連接符號"\" : mplayer Me\ like\ yuh.mp3“\”告訴系統(tǒng)后面跟著的字符為原意,不是命令
參考:linux命令行下進(jìn)入帶空格的文件夾的方法
完畢。
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。