Introduction
This article aims to provide instructions for the use of the find command with "inum" and "exec" to handle files that otherwise don't work with your SSH terminal.
Procedure
If you're seeing errors when trying to type a file's name, or otherwise can't escape the characters, you can always use the files inode number to modify it.
For example, given the following files using the "ls" command with the "-i" option for inode:
# ls -lAhi
total 0
3653039 -rw-r--r-- 1 root root 0 Aug 25 07:35 o?=%82P0o?=%8E-P
121635355 -rw-r--r-- 1 root root 0 Aug 25 07:37 йeftest
We can rename one of them without ever typing the special character:
# find -inum 121635355
./йeftest
# find -inum 121635355 -exec mv -iv {} newname \;
‘./йeftest’ -> ‘newname’
The command above uses "-inum $inodenumber" to specify the file, then runs "-exec" to execute an operation on the file. "{}" represents the filename, newname is the new filename, and "\;" terminates the "exec".
Comments
0 comments
Article is closed for comments.