Unable to copy or move file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unable to copy or move file
# 1  
Old 05-28-2009
Unable to copy or move file

I am trying to move a file that is in the root directory. I suspect it is an old file created by someone when the system was installed. I am testing accessing the file by doing a copy but the command does not find the file.

I am operating as root. We are HP-UX B.11.23

I do long listing and see the file... -rw-rw----- 1 batchlet bsp 18629533 Apr24 2007 baan

I check for inode number “ls -i and the file name does not appear.

I check for nonprinting characters “ls -b” and receive baan\010\010\010\010\010\010\010\010\010\010\010\010

I have tried doing the copy using a wild card after the file name and again with wild before and after the name and it does not find the file.
phcorn
# 2  
Old 05-28-2009
Hammer & Screwdriver Use unix type-ahead feature?

Perhaps you can use the type-ahead feature, available in different ways depending on the unix flavor.
For me here with bash, if I type

cp abc
then hit <Esc> <Esc>

unix will autom-complete and fill in the full filename

Maybe you could use that feature to have the op system find your filename so it can be renamed?
# 3  
Old 05-28-2009
\010 is the BS ascii #8 character. BS == backspace.

One way
Code:
touch junkfile
mv -i *  junkfile

make sure your mv command supports the -i option FIRST.

be careful with this - you have to keep answering N until you hit your problem file.
then after you create the newfilename, hit control/C
# 4  
Old 05-28-2009
No luck.

I also find it curious that only way to see the file in a listing is to use long listing, “ll” or “ls –b”. It does not show up with “ls” or “ls” with numerous other switches I’ve tried.

Judging from the date the file would have been created prior to this server going live on production and it is a user who is not familiar with UNIX. It was probably dumped there by mistake and the user did several backspaces or something of that nature.

I wonder if the file even exists.

-----Post Update-----

I had tried “cat” and “more” to look at the file and neither worked. Received error message that no file found by that name. I then tried vi and it allowed us to open the file. Afterward we still could not copy or move the file but the remove command which we had not tried before worked. I still don’t know what the root cause was but the file has been deleted.

Thanks for you comments and assistance.

-----Post Update-----

I had tried “cat” and “more” to look at the file and neither worked. Received error message that no file found by that name. I then tried vi and it allowed us to open the file. Afterward we still could not copy or move the file but the remove command which we had not tried before worked. I still don't know what the root cause was but the file has been deleted.

Thanks for you comments and assistance.
phcorn
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Separate the apache user file and move or copy some were

Hi all, I'm Using Centos 6.4 /opt/my_aplication/entry/data/0/ There are Thousands of files in this Directory, Only i need to copy or move the apache User's file from this to /tmp/backup , I have listed apache user's file using find . -user apache -type f , its gave me the only apache... (2 Replies)
Discussion started by: babinlonston
2 Replies

2. Solaris

Can't erase/move/copy file!

Hey everyone!. I have a problem with a file that doesn't allow any operation on it. I can't rm,mv,cp nor any other operation to it, I get the following errors: bash-2.05# mv ora_2527.aud /bkp mv: cannot access ora_2527.aud bash-2.05# cp ora_2527.aud /bkp cp: cannot access ora_2527.aud... (4 Replies)
Discussion started by: dragonov7
4 Replies

3. Shell Programming and Scripting

After FTP unable to move file to other location

Hi Experts, I am using below script and facing some problems.. cd /home/user/test rm ftp://ftp.log Example: A_Bachfile_09292011.txt A=`ls -1 "A*.txt"` compress $A C=`ls -1 "A*` hostname="test.gmail.com" user="raju" Password="******" ftp -n $hostname <<EOF >>ftp.lpg... (4 Replies)
Discussion started by: rajubollas
4 Replies

4. Shell Programming and Scripting

Copy or Move problem

Hi All, I have a simple shell script to move .txt file(s) from a source directory one after another to the destination. The source directory is shared to windows using samba. The source files are arriving continuously and approx size is 10-15 KB. Some time the file size reached upto 100 KB and... (9 Replies)
Discussion started by: sraj142
9 Replies

5. UNIX for Dummies Questions & Answers

Unable to copy file using SCP (Input/output & Permission denied error)

Hi, I am facing issue while using scp. Source & target machines are Linux & HP-UX respectively. On target machine, if I fire the following command, I get error: Now if I try scp on another file, which is on the same source machine, it works fine. All directories and subdirectories... (2 Replies)
Discussion started by: Technext
2 Replies

6. Shell Programming and Scripting

Copy/move file which are not currently in use.

Hello experts, I'm doing a shell script that able to copy or move files. My situation is i have a drive ( lets say its S drive) where its receive all the files from mainframe i need to copy all the file from S drive to T drive. but only those files that are finished copied from mainframe... (5 Replies)
Discussion started by: CelvinSaran
5 Replies

7. Solaris

unable to move processors in pset

bash-3.00# poolcfg -d -c 'transfer 8 from pset pset_default to pset-app' poolcfg: cannot transfer 8 from pset_default to pset-app: Invalid configuration bash-3.00# why i 'm getting this error ? (2 Replies)
Discussion started by: fugitive
2 Replies

8. UNIX for Dummies Questions & Answers

How to copy/move to a file with a special character as the 1st char in the filename?

I am trying to create files with special characters in its filenames for testing purposes. This is on a Linux RHEL4 but this should also be applicable on a Unix shell. I am able to create files with special characters in the filenames...e.g. cp -pv foo.gif \*special.gif cp -pv foo.gif \... (6 Replies)
Discussion started by: sqa777
6 Replies

9. Shell Programming and Scripting

Bash Copy-Move file problem

Hello, I made a script to copy files from one directory to another and move file after the copy is done. When files are present in the source directory there is no problem but when no file are present I'm getting an error. Please help !! --------------------- #!/bin/bash ... (2 Replies)
Discussion started by: lsimoneau
2 Replies

10. Shell Programming and Scripting

Help with Copy Move Script

Hello Gurus! Please help! I would like to get some help with the following: I'm working right now on a Data Warehouse project and I need to automate a manual procedure I am using to process the data files coming into the database, any information/ideas and or which script language to go... (4 Replies)
Discussion started by: alfpathros
4 Replies
Login or Register to Ask a Question