问题描述
我使用cmd显示了目录中的所有文件,
ls/home/user1/.现在,我需要显示此目录中存在的特定文件的所有内容
例如.
ls/home/user1/tmp/包含三个文件
sample1.txt sample2.txt sample3.txt sample5.js sample6.html
如何仅显示这些文件中存在的.txt文件的内容
我已经累了ls/home/user1/tmp/| grep''.txt $''|猫/home/user1/tmp
但这并不能按照我的需要工作.
请帮忙.感谢advancd
Hi,
I displayed all the files from a directory using the cmd,
ls /home/user1/. Now I need to display all content of particular files present in this directory
For ex.
ls /home/user1/tmp/ containt three files
sample1.txt sample2.txt sample3.txt sample5.js sample6.html
How to display only the content of .txt files present in these files
I have tired ls /home/user1/tmp/ | grep ''.txt$'' | cat /home/user1/tmp
But it is not working as I need.
Please help. Thanks in advancd
推荐答案
cat /home/user1/tmp/*.txt
这篇关于打印特定目录中文件的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!