-
How to open a file with a space in the name
i was just wondering, how would you go about opening a folder in the command line if there is a space in the directory name? thanks a lot
Last edited by je_fro; 07-19-2005 at 09:30 PM.
linux user #388813
Gateway SOLO 5300
Pentium III 750 Mhz
256 MB RAM
20 GB HD
Mandrake 10.1
-
this is probaly going to get locked because you did not follow the posting guidelines.
and you use a \ in the name
soule
Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others. - Edward Abbey
IRC #linuxn00b
Support your Distro.
Slackware Store
Archlinux Schwag
-
Or enclose it in " marks.
"After all you've seen, after all the evidence, why can't you believe?"
IBM Thinkpad T21
750 Mhz P3, 128 MB PC100 RAM, CD-ROM, 10 GB IDE HDD
Ubuntu 9.04 Minimal
-
I usually just press <Tab>.
Knute
You live, you die, enjoy the interval!
-
Not gonna close it since it already got answered, but they're right. Please read the posting guidelines which are at the top of each forum.
irc.freenode.net #justlinux The Not So Official JL IRC Channel.
¤ Debian ¤ Apt-Get ¤
-
In general, Unix/Linux cmds don't like names with spaces in, although you can use either of the above suggestions to cope ...
Personally I'd rename the file/dir if at all possible, even if it means altering other scripts that have it hardcoded. Otherwise you'll come up against this on a freq basis.
Cheers
Chris
-
well the only reason i ask, is because if im running windows, and i need to boot into knoppix to get into the computer, and i want to get a document stored in "My Documents" i didnt know how to, but now i do, and im very greatful for everyones help!
Last edited by hurleyint1386; 07-20-2005 at 03:41 AM.
Reason: spelling error
linux user #388813
Gateway SOLO 5300
Pentium III 750 Mhz
256 MB RAM
20 GB HD
Mandrake 10.1
-
While we're on this topic, I've saved a lot of time, headaches, and escape-character punching with the following script.
Code:
#!/bin/sh
# Renames all the files in the current directory to lowercase and
# replaces spaces with underscores.
for i in *; do
echo mv "$i" `echo "$i" | tr ' ' '_' | tr '[:upper:]' '[:lower:]'`
done
echo
echo "Enter to accept:"
echo
read foo
for i in *; do
mv -v "$i" `echo "$i" | tr ' ' '_' | tr '[:upper:]' '[:lower:]'`
done
Pretty rough, even for a five minute job, but it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|