term syntax: spaces?

Posted:
in macOS edited January 2014
I forgot how to type a literal space in a file name from the cli terminal.



What are the chars for a space?



ie: rm this file has spaces.txt



Thanks!

Comments

  • Reply 1 of 3
    torifiletorifile Posts: 4,024member
    rm this\\ file\\ has\\ spaces.txt



    Or you could type rm and drag the file to the terminal window and the path will come up automatically. Or you could start the path and tab to complete it. HTH.



    [ 05-23-2002: Message edited by: torifile ]</p>
  • Reply 2 of 3
    amorphamorph Posts: 7,112member
    also: rm "this file has spaces"
  • Reply 3 of 3
    aslanaslan Posts: 97member
    You can also enclose it single quotes, just remember that it will be REALLY literal (whereas double quotes still allow for variable name and pattern evalutation/expansion)



    Might as well be thorough...
Sign In or Register to comment.