I am trying to get my terminal to return the last .txt file with an intact outline. I studied ls, grep, find and tail using '|' functionality for transferring results from one utility to the next. The end result would be to have a work path + result so that I can pass in a text editor.
I approached such tests: to find. | grep '.txt $' | tail -1
.. but I was not lucky when grep returned a new file - is there a flag that I am missing?
Trying to use find and ls also does not work:
to find. -name "* .txt" | ls -lrth
.. ls returns the current directories instead of the results of my search query.
Please, help!
source
share