Results 1 to 5 of 5
  1. #1

    Member Since
    Feb 14, 2008
    Newbie using terminal
    In Tiger I'm using Pico in Terminal to write html pages.
    I don't know how to change to directories that have spaces, quotes or underscores in their names.
    When I type the full name, or the first 6 characters followed by ~1, Terminal just goes to a new line consisting of > and does not respond to any commands.
    Can I move into my long directory name_files or open a file within it? or do i have to rename everything to a name that Terminal can cope with?
    Advice would be gratefully received.

  2. #2

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Groves, Texas
    21in. iMac 10.11 --- HP Linux Mint 18
    To cd to a folder with a space in it you need to "escape" the name. For instance:
    cd ~/folder/'folder with space'
    You can also use a " as an escape.
    Naming folders with quotes is NOT recommended.
    Folder names with underscores should work correctly as is.
    Any priest or shaman must be presumed guilty until proved innocent.

  3. #3

    Member Since
    Dec 31, 2007
    Remember that you can use the \ as the escape. For example you have a file called:

    /Users/Frank Sinatra/my songs/"Eye" by Smashing Pumpkins, the.mp3

    You can use it in terminal as:

    /Users/Frank\ Sinatra/my\ songs/\"Eye\"\ by\ Smashing\ Pumpkins\,\ the.mp3


    '/Users/Frank Sinatra/my songs/"Eye" by Smashing Pumpkins, the.mp3'

  4. #4

    Member Since
    Feb 14, 2008
    Thank you very much.
    Both work.
    I've also discovered the use of the wild card * gives every file that starts with the typed characters. Good shorthand for where there are few files or folders to choose from. Sticking the * in the middle of the path allows you to define the starting and ending characters of the files or folders you want to select.

  5. #5

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Tucson, AZ
    Way... way too many specs to list.
    Keep in mind you don't actually have to type all that either. OS X, like many other *nix OS's has tab completion. So for example in the above commands I'd type

    /Us (hit tab, so it'll now say)
    /Users/ (then type) Frank (hit tab)
    /Users/Frank\ Sinatra/my (tab)

    etc it will continue to build the command structure for you. I hope that made some sense, if not... try hitting the tab key while you're typing out your file path and see what happens.
    This machine kills fascists
    Got # ? phear the command line!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Month in Terminal is in Russian - only in Terminal!
    By yoandrew in forum macOS - Operating System
    Replies: 4
    Last Post: 12-29-2012, 09:20 AM
  2. Terminal Help?
    By DaveS in forum macOS - Apps and Games
    Replies: 10
    Last Post: 09-20-2011, 08:54 PM
  3. Newbie to Terminal-Locked hard drives help.
    By jwalte in forum macOS - Operating System
    Replies: 5
    Last Post: 04-08-2011, 07:49 AM
  4. Terminal
    By stevenyc in forum macOS - Operating System
    Replies: 7
    Last Post: 02-28-2007, 03:49 PM
  5. newbie help (dumb terminal settings?)
    By CaptainMack in forum macOS - Development and Darwin
    Replies: 10
    Last Post: 02-17-2004, 07:25 PM

Posting Permissions

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