简体   繁体   English

写一个列出目录内容的脚本?

[英]Write a script that lists the content of a directory?

How can i write a script that lists the content of a directory and the sub directories on linux shell script ? 如何在Linux Shell脚本上编写列出目录和子目录内容的脚本?

find ~/Desktop/Sample/ -type f - Like that 找到〜/ Desktop / Sample / -type f-这样

此行将创建您的脚本并为其授予执行权限:

echo -e '#!/bin/bash \nfind ~/Desktop/Sample/ -type f' > your_script.sh && chmod +x your_script.sh

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 编写一个bash脚本,列出所有文件和子目录 - Write a bash script that lists all files and subdirectories 如何为 bash 编写脚本来归档目录并保留其名称? - How to write a script for bash to archive a directory and keep its name? 在Linux中编写脚本以在每个子目录中运行make,深度为2 - Write a script in Linux to run make in every child directory maxdepth of 2 递归比较两个目录,使用shell脚本将目录内容复制到第三个目录 - Comparing two directory recursively, copy content of directory to third directory using shell script 如何编写将一个目录下的所有文件和目录复制到另一个目录的linux脚本? - How to write a linux script that copies all the files and directories under one directory to another directory? 编写一个 linux 脚本,将目录作为参数,然后将该目录中最长的条目打印为 output - Write a linux script that takes a directory as an argument and then prints the longest entry in that directory as an output 是否有 linux 命令循环遍历目录中的文件,然后将所有文件名和内容写入 csv 文件? - Is there a linux command loop through files in a directory then write all files names and content into csv file? LINUX-Shell脚本查找并列出所有有权在目录树中写入的文件 - LINUX - shell script finding and listing all files with rights to write in directory tree 如何编写一个带有一个参数的bash shell脚本(目录名) - How to write a bash shell script which takes one argument (directory name) 如何编写UNIX命令或脚本来删除当前目录下所有子文件夹中相同类型的文件? - How to write a unix command or script to remove files of the same type in all sub-folders under current directory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM