- Joined
- Jul 23, 2009
- Messages
- 2
- Reaction score
- 0
- Points
- 1
I am trying to pipe the output from the which command to change directory with the following line of code
I assumed this would change my current directory to where the ls command is located, i.e. /bin. I know in this case it is easier to type
but if the directory I want is 5 levels deep the piping method would be quicker. Thanks in advance.
Code:
which ls | cd
I assumed this would change my current directory to where the ls command is located, i.e. /bin. I know in this case it is easier to type
Code:
cd /bin
but if the directory I want is 5 levels deep the piping method would be quicker. Thanks in advance.