Results 1 to 7 of 7

Thread: Command line question from somewhat of a beginner

  1. #1
    Join Date
    Jan 2013
    Beans
    2

    Command line question from somewhat of a beginner

    I searched goog and this forum to no avail so now I ask simply why
    Terminal doesn’t want to understand spaces in file names.
    /media/Storage HD/other folder/ and so on look correct or am i missing something.
    It stops at storage:file not found, do i need underscore or something _ - / \ * "" ???
    I can install and run programs and stuff, but other than that I’ve had no luck.
    Hopefully my question as well as the answer are simple enough.
    so thanks in advance.

  2. #2
    Join Date
    Apr 2012
    Beans
    6,947

    Re: Command line question from somewhat of a beginner

    You can either enclose the filename with quotes

    Code:
    "/media/Storage HD/other folder/"
    or escape the spaces with backslashes

    Code:
    /media/Storage\ HD/other\ folder/

  3. #3
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 16.10 Yakkety Yak

    Re: Command line question from somewhat of a beginner

    Use the Tab key and have the shell complete file or folder names for you, including ones with spaces.

  4. #4
    Join Date
    Dec 2006
    Beans
    7,305

    Re: Command line question from somewhat of a beginner

    ...and avoid spaces in filenames.
    You think that's air you're breathing now?

  5. #5
    Join Date
    May 2009
    Location
    Fareham, UK
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Command line question from somewhat of a beginner

    As to why, its because the terminal uses 'white space' (meaning any empty space or spaces) as a way to separate input into fields to be handled separately (called arguements), its a standard convention that is used because otherwise the terminal wouldn't know what bit you typed is the command name and what bit is telling it what you want to do etc.
    Catch me on Freenode - imark

  6. #6
    Join Date
    Apr 2012
    Location
    Quebec, Canada
    Beans
    261
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Command line question from somewhat of a beginner

    You can also drag and drop the file you want to launch in the Terminal. It will automatically add single-quote caracters ( ' ).

  7. #7
    Join Date
    Jan 2013
    Beans
    2

    Re: Command line question from somewhat of a beginner

    Wow quotation marks, now i feel dumb. All works now,so i can work off external hard drives instead of moving to the desktop.
    thanks all and extra thanks for the scientific answer, it helps every thing make a bit more sense.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •