moving folders

Colin Watson cjwatson at ubuntu.com
Wed Feb 9 20:33:47 UTC 2005


On Wed, Feb 09, 2005 at 09:46:11PM +0200, Ari Torhamo wrote:
> ke, 2005-02-09 kello 16:32 +0000, Colin Watson kirjoitti:
> Tab-completion - very handy. I tried it onece, but already forgot that
> such thing exists :-( I have to learn to use quotes too (do I have to
> quote the whole path, or is it enough just to quote the file name? (two
> quotation marks in both cases - I know :))

You can do either. Quotes are processed anywhere within a word, so the
following are all equivalent:

  '/this/is/a/long path containing spaces'
  /this/is/a/'long path containing spaces'
  "/this/is/a/long path containing spaces"
  /this/is/a/"long path containing spaces"
  '/this'"/is/a"long\ path\ containing\ spaces

("" does behave differently to '' in some ways; the $, `, and \
characters are special within "", whereas no characters other than '
itself are special within ''. For the full gory details, search for
'QUOTING' in 'man bash'.)

Fortunately, tab-completion takes care of this for you when it can:

  <cjwatson at cairhien ~>$ touch 'filename containing spaces'
  <cjwatson at cairhien ~>$ cat file<here I hit TAB>
  <cjwatson at cairhien ~>$ cat filename\ containing\ spaces

Cheers,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list