I am running the command
ls *my_file.txt* | xargs vim
The shell throws a warning message:
Vim: Warning: Input is not from a terminal
following that the file is opened. Note there is only one instance of *my_file.txt*. On exiting the file, I see that on each ENTER the prompt is not on the next line but continues on the same line. The characters are not typed on the display but are buffered and executed on subsequent enter. Basically, the display gets awry.
The intent is basically to pipe the searched file_name to vim. So any alternative solutions are welcome.
Use
findandexecinstead ofxargs.You can add more options to
findlike-depthto restrict traversing recursively,-regexfor complex regular expressions for finding files etc.