LinuxQuestions.org
Register a domain and help support LQ
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 04-24-2008, 06:04 PM   #1
klohmann
LQ Newbie
 
Registered: Feb 2006
Location: New Hapshire
Distribution: Ubuntu, Xandros, Debian
Posts: 4

Rep: Reputation: 0
How to reconcile ' in directory name


I have a user that uses a directory name that includes the character '. When I attempt to access the directory from the command line, I get the > character, indicating (I think) that the command line is waiting for additional input. Other than the obvious answer of making the user rename the directory without the ' character, how do I execute linux commands from the command line in directories that include the character?

Any assistance would be appreciated.
 
Old 04-24-2008, 06:13 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
You can *escape* the apostrophe with the backslash: like so \'
That prevents the shell from trying to intrepret it as the lead apostrophe in something that is enclosed in quotes, and consquently waiting for the trailing quote.

Last edited by bigrigdriver; 04-24-2008 at 06:15 PM.
 
Old 04-25-2008, 10:18 AM   #3
klohmann
LQ Newbie
 
Registered: Feb 2006
Location: New Hapshire
Distribution: Ubuntu, Xandros, Debian
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bigrigdriver View Post
You can *escape* the apostrophe with the backslash: like so \'
That prevents the shell from trying to intrepret it as the lead apostrophe in something that is enclosed in quotes, and consquently waiting for the trailing quote.
Thanks very much. That did the trick. Wasn't sure where else to look to get the answer. LQ is fast, effective and functional! Thanks for your help. K.
 
Old 04-25-2008, 01:33 PM   #4
ararus
Member
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 56

Rep: Reputation: 15
It sounds like you're not using tab completion, which should automatically escape any shell metacharacters?

Just type a few letters of the pathname, then whack the tab key and it will complete the it (assuming it's unique), escaping any characters the shell considers special.
 
Old 04-29-2008, 07:47 PM   #5
klohmann
LQ Newbie
 
Registered: Feb 2006
Location: New Hapshire
Distribution: Ubuntu, Xandros, Debian
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ararus View Post
It sounds like you're not using tab completion, which should automatically escape any shell metacharacters?

Just type a few letters of the pathname, then whack the tab key and it will complete the it (assuming it's unique), escaping any characters the shell considers special.
Ararus:

You know, I knew that, but somehow, I didn't make the connection. Thanks very much! K.
 
  


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
Username & Password Sync Fedora Directory and Microsoft Active Directory karnac01 Fedora 4 07-19-2010 01:51 AM
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 07:33 PM
LXer: Using a hypervisor to reconcile GPL and proprietary embedded code LXer Syndicated Linux News 0 08-28-2007 02:50 AM
LXer: Directory services made easy with Fedora Directory Server LXer Syndicated Linux News 0 12-08-2006 04:54 AM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 07:54 PM


All times are GMT -5. The time now is 08:29 AM.

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