findind目录和文件列表 [英] findind list of directories and files
本文介绍了findind目录和文件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要编写linux代码来接受作为参数传递的查找文件和目录列表"的功能....
我需要指导.请帮助我.....
ls -l可以用于此目的,但是如何传递参数
i need to write the linux code for aceiving the functionality of "finding list of files and directories" that is passed as an argument....
i need guidence. please help me.....
ls -l can be used for the purpose, but how to pass the argument
推荐答案
请参见 ^ ]来帮助您的基本程序.
See here[^] for a base program to help you.
如果您正在寻找shell脚本方法,您可以使用以下方法之一.
方法1:运行脚本后,从用户读取输入.
If you are looking for the shell script method, you can use one of the below methods.
Method 1 : Read Input from the User After Running the Script.
#!/usr/bin/bash
echo " Enter the Directory Name From which you need to get the list of the Files "
read directoryPath
echo " The Directory You have entered is [
directoryPath]" 如果[-d"
directoryPath ]" if [ -d "
这篇关于findind目录和文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文