B
B
benderspb2011-09-29 22:06:56
bash
benderspb, 2011-09-29 22:06:56

bash How to pass the newest file in a directory as a parameter to a command

need help. It is often required to do the same actions with different file names. Which command will output the name of the most recent file in the directory to feed it to another command?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zhurbitsky, 2011-09-29
@blo

ls -t /path/ | head-n1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question