When I run this command it works:
$ find . -inum 888696 -exec ls '{}' \;
Conversation.pst Outlook Data File Outlook Data File.sbd Trash Unsent Messages
Inbox.pst Outlook Data File.msf Sent.pst Trash.msf Unsent Messages.msf
However, When replacing ls
with cd
it does not work:
$ find . -inum 888696 -exec cd '{}' \;
find: ‘cd’: No such file or directory
I know cd
is a bash
built-in, so I tried this which does not work either:
$ find . -inum 888696 -exec builtin cd '{}' \;
find: ‘builtin’: No such file or directory
How can I use cd
along with find -exec
command?
UPDATE
The reason I'm trying to use cd
with find -exec
is that the directory name is a strange one which shows up on my terminal as something like ????
.
LC_ALL=C printf '%q\n' *
to print ASCII names for all files in your current directory, one to a line (changing newlines to$'\n'
or similar). – Charles Duffy Jun 05 '18 at 19:53