I think the simplest way is to use more
or less
of the pager.
(Assume that only files that can be displayed as text exist in this directory)
$more*.txt
or
$ less*.txt
more
automatically moves to the next file when it terminates.
For less
, navigate to the following file in :n
.
find.-type f | xargstail-n+1
or
find.-type f-exec cat{}\;
would be good.
command line-Show contents of many files-Unix&Linux Stack Exchange
I think pr
is better if you want to display it with a file name and line number.
find.-type f | xargs pr-n-f | less
find.-name "*.c" | xargs pr-n-f |less
With zsh, **
you can write wildcards that match multiple levels of directories, so for example,
$wc**/*.h
Then you can wc only the "*.h" file, including the ones that are deep below the current one.
[Edit after posting]
If you simply want to view the contents of the file, you can use commands such as more and less as well as cat.
© 2024 OneMinuteCode. All rights reserved.