is it possible to redirection the output of a command to "cd"? For example, I have searched for a directory using locate and got the path to it. Now, instead of writing cd path, can I redirect the output to cd?
I've tried this:
oliver@nell:~$ locate Descargas | grep Descargas$
/home/oliver/Descargas
oliver@nell:~$ locate Descargas | grep Descargas$ | cd
oliver@nell:~$ locate Descargas | grep Descargas$ > cd
oliver@nell:~$ locate Descargas | grep Descargas$ < cd
/home/oliver/Descargas
oliver@nell:~$
But no luck. It probably isn't something very useful but I'm curious
Thanks