LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-22-2007, 08:21 AM   #1
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Rep: Reputation: 15
Directory name cause scp errors


I have a user that has created a directory called newDirectory?ls -al?mkdir newDirectory

I was attempting to do a backup by scp'ing the files to another server.. but this directory caused an error... but even though ls will list the directory i can not, cd into it or rename it. The server just says No such file or directory..

how can a gain access to the file or rename it, is there another method?
 
Old 11-22-2007, 10:17 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
Try putting single quotes around it and renaming:

mv 'newDirectory?ls -al?mkdir newDirectory' sensiblename

You might need to escape the '?'s also

mv 'newDirectory\?ls -al\?mkdir newDirectory' sensiblename

also, beat user around head with manual...
 
Old 11-23-2007, 04:13 AM   #3
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Original Poster
Rep: Reputation: 15
Thanks but it still does not seem to recognise the directory it just returns a No such file or directory. even with the \ before ?

The only thing i can thing of is rm -r hte whole directory an then replace the files, but i cant get into the directory to check to see if an files are in there..

Any other ideas?
 
Old 11-23-2007, 04:22 AM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Try to escape like this
Code:
cd newDirectory\\\?ls\ -al\\\?mkdir\ newDirectory/
 
Old 11-23-2007, 08:27 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
The ? character might be some strange character which cannot be displayed correctly in your terminal, and the font/terminal emulator chooses ? to indicate this... To find out what is actually in the file name use the -b option to ls, which will print non-printable characters as their octal encodings.
 
Old 11-23-2007, 12:58 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Or just use the tab-expansion method ;} Chances are bash will
be working the quoting out for you.



Cheers,
Tink
 
Old 11-23-2007, 01:21 PM   #7
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Original Poster
Rep: Reputation: 15
The tab worked thanks very much! I cant believe i never tried it.. but thanks everyone for you help..

Ross
 
Old 11-23-2007, 01:30 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Sweet :}

Cheers,
Tink
 
  


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
SCP: No such file or directory...but its there!? Baix Linux - Newbie 20 07-28-2012 02:42 PM
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
Creating a link from "." to other directory on SCP bujecas Linux - Security 4 02-01-2007 10:54 AM
/home directory is full :S .xsession-errors carl0ski Linux - Distributions 5 12-20-2004 04:46 PM
No such file or directory errors Zotty Programming 4 09-11-2004 09:27 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration