I was solving a problem on a popular hacking for fun website, when I got following idea:

Is it possible to represent - for example a '/' (just the slash) in the terminal (linux) in another way - for example hexadecimal:


cd /etc/


cd %2F etc %2F

is this somehow possible? Even though in this example I am using a special character (%) again.

1 Answer 1


Yes, this is possible. In most shells, there are plenty of ways to do this. Any way you can encode and decode something in a subshell into ASCII will work. A few examples for bash:

cd $(printf '\x2fetc')
cd $(base64 -d <<< 'L2V0Ywo=')
cd $(awk 'BEGIN{printf("%cetc",47);}')
cd $(cut -b1 <<< $HOME)etc
eval $(base64 -d <<< 'Y2QgL2V0Ywo=')

Everything in the subshell is evaluated first, so these all become:

cd /etc

There are countless other ways to do this, many far more obfuscated than anything I've put here. But if all you want to do is change directories without using a /, any of these should suffice perfectly. Note that some of these use bash-isms and are not perfectly POSIX-compliant.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .