I would like to find the directory which keeps a certain file and cd there. e.g.
find * -name hello.txt
output: Documents/Projects/hello.txt
cd Documents/Projects
How do I pipe these commands? Thanks!
|
I would like to find the directory which keeps a certain file and cd there. e.g.
output: Documents/Projects/hello.txt
How do I pipe these commands? Thanks! |
|||||||
|
|
Try
or
You'll need to provide a EDIT and if you have spaces in your filenames
and if you have spaces in your directory names too
|
|||||||||||
|
|
Instead of finding all and
|
||||
|
|