Newly Modified file , created and list huge files in CMD

霸气de小男生 提交于 2020-06-07 07:22:28

问题


I have magento 2.2.6 website in aws server (EC2).I am connecting to that aws sever using ssh in cmd From my windows 10 computer . I have a directory (folder) named Var in aws server. Inside var folder there are so many files and sub folder . Now i have the following question

1) I want to know the list of last modified files (or i want to get file modified after 2.00pm today )

2) I want to know the list of last created files (or i want to get file modified after 2.00pm today )

3) I want to list the files or folders that have size more than 1 gb

4) I want to know the folder size of one folder

Please help to solve this issue . I want cmd code . Actually i have issue in my website . To solve that i have to get the answer for these questions . Please help .


回答1:


You can use du -sh to get folder size. More examples are available here. You can use 'ls -halt' to sort files by date or reverse it using ls -haltr, you your can read this stackexchange link on how to sort by date using various other ways.

You can use find . -type f -size +1000M to find files lager than 1GB, or if you want to limit it to the current folder you can use find . -maxdepth 1 -type f -size +1000M. You can read this link on how to find files larger or smaller than.



来源:https://stackoverflow.com/questions/61984854/newly-modified-file-created-and-list-huge-files-in-cmd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!