Solved

Long Directory Name

Posted on 2000-04-19
6
193 Views
Last Modified: 2012-05-04
Hello, currently I am using Window 98 and Redhat Linux 6.1. I got a problem, that is: I mount my hda1 (windows partition) and "use" it from linux. Seem that I can't access to windows c:\program files (because of blank between program and files !!), What should I do if I want to access into this directory ???
0
Comment
Question by:ahchong
6 Comments
 

Accepted Solution

by:
R_Walsdorf earned 10 total points
ID: 2731939

I know (offhand) 4 Solutions to this problem:
- Use " ",  ex.: cd "Program Files".
- Instead of " " use "\ " which makes it possible
   to use spaces and other "special" chars.
- Use the tab key to fill up the    
   missing/problematic chars (works with bash,
   and add's the "\" where necessary    
   automatically). This will only work when the
   enough of the filename is known to "guess"    
   correct.  
- Use Midnight Commander (if installed you can  
   start the program with "mc")

0
 
LVL 3

Expert Comment

by:DVB
ID: 2731970
Lets say your windows partition is mounted on /win. Then cd "/win/program files" to cd to that directory. Else try using auto completion, just press the tab key to complete the filename.
Do:$cd /w <TAB>
Get:$cd /win
Do:$cd /win/pr <TAB>
Get:$cd "/win1/program files"
This works.
0
 

Expert Comment

by:ibishop
ID: 2732792
The "easy way" is to use the format that MICROS~1 themselves have pioneered - take the first 6 letters of the directory, then add ~1

The only time this sometimes has problems is when you have multiple directories with the same 1st 6 characters (usually in Program Files when you have lots of MS apps installed - you'll see MICROS~1,~2,~3,~4, etc.)

However, for the typical stuff, just something like :

cd /dosmnt/Progra~1

will do the trick for you.

Ian
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 2

Expert Comment

by:fremsley
ID: 2733632
ibishop: the short aliases are not available when the partition is mounted as 'vfat', you would have to mount it as 'msdos'.
0
 
LVL 3

Expert Comment

by:DVB
ID: 2735459
Huh, my answer went missing??
Anyways, to repeat:
Use quotes
Assume that thw windows partition s mounted on /win.
cd "/win/Program files/"
I would recommend that you use auto completion, by just pressing the tab key.
Type in the minimum number of characters to uniquely identify the file, and press the tab key. It autoinserts quotes where necessary.
0
 
LVL 3

Expert Comment

by:DVB
ID: 2735469
Ignore the second post. That will teach me not to use kfm!!
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now