简体   繁体   中英

Linux console script to get file size and modified date based on prefix?

i need to write a consol script that recieves two parametrs - a location and a string prefix, and outputs the modified time and size of every file in the location that starts with the given prefix.

for example

myscript.sh /localdisk st

will out put something like

start.txt 11111 Dec 2 14:41
stop.jar 1432 Dec 1 11:21
stud.gz 1122 Nov 2 10:12

any ideas? Thanks!

像这样的东西:

find $1/$2* -printf "%f %s %TY-%Tm-%Td %TH:%TM\n"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM