LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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: 65
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: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Sweet :}

Cheers,
Tink
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:40 PM.

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
Open Source Consulting | Domain Registration