Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Long Directory Name

Posted on 2000-04-19
6
217 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

856 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