LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2004, 06:20 AM   #1
singedwings
LQ Newbie
 
Registered: Jul 2004
Location: Brighton, UK
Distribution: Ubuntu 6.06
Posts: 7

Rep: Reputation: 0
Question directory with a space


In the console how do you access a directory that has a space in the name? i.e. a directory with the name system files
 
Old 08-24-2004, 06:31 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Use spaces around the name eg: ls 'system files'.
Be aware that most Unix/Linux cmds do not cope well with this scenario ie try to avoid using spaces in names if possible.

edit: oops... yes i meant use quotes....
BTW, I think myriad-zero means leading backslash ie \
The advantage of using single quote marks is that if the dirname is stored in a variable. you don't have to parse it and insert the leading \'s.

Last edited by chrism01; 08-24-2004 at 10:29 AM.
 
Old 08-24-2004, 06:37 AM   #3
myriad-zero
Member
 
Registered: Aug 2004
Location: /india/tn/chennai
Distribution: Debian
Posts: 38

Rep: Reputation: 15
Two options to change to the directory with the name "system files"
Code:
# cd "system files"
or
Code:
# cd system\ files
Note that spaces need to be escaped with a leading '\'. This would be applicable for all commands to access the directory.

HTH.
 
Old 08-24-2004, 06:49 AM   #4
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
I think chrism01 meant use quotation marks around the path string. There's many different types though (" ` ') and it isnt the best solution. I'm assuming the system files directory is on a mounted windows drive so it's probably best to not rename it, so be careful when manipulating it.
 
Old 08-24-2004, 06:55 AM   #5
singedwings
LQ Newbie
 
Registered: Jul 2004
Location: Brighton, UK
Distribution: Ubuntu 6.06
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks that solved my problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't delete directory with space in name budhead Linux - Software 12 12-02-2014 11:21 AM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 01:44 PM
allocated space of a directory Dave31836 Programming 8 10-04-2004 07:07 PM
change into directory with space in it? sideveloper Linux - Newbie 3 03-06-2004 05:18 PM
Directory Space under /home tarak4u Linux - General 1 02-21-2004 11:10 AM


All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration