You are not logged in.
Hi!
I have some files/directories with very weired characters in the filename.
So, I was unable to rename them to something that is accessible by its filename.
However, I can see their inode.
Is there anyway that I can rename a file just by using its inode?
thx
Last edited by phabulosa (2008-03-18 23:11:30)
Offline
You can try using "find" to get the name of the file with that inode and then pipe that to "mv"
Offline
You can try using "find" to get the name of the file with that inode and then pipe that to "mv"
I need to do this on a embedded busybox environment, so the 'find' utility does not has a feature of -inode.
However, I achieved my goal by doing the following:
1. Figure out the inode of a file/directory by
ls -i
2. Use a variable to save the filename which cannot by typed in due to weired characters
xyz=`ls -i|grep 705|sed 's/48840705 //'`
3. Rename by
mv "$xyz" filename_I_want
Offline
Want to mark it 'solved' and make a wiki contribution?
Offline
What about this:
find . -type f | (let i=0; while read f; do mv "$f" file-$i ; let i=$i+1; done)
(assuming you want to salvage names for all files in current directory)
Offline
Want to mark it 'solved' and make a wiki contribution?
How to easily quote this thread to form a wiki for Arch?
Offline