ls -l | awk '/^[^d]/ {print $5,$9}' | sort -nr | head -1
ls查看完整的文件信息,過濾掉d開頭的東東(目錄),取出文件大小
find -type f -exec stat -c "%s %n" {} \; | sort -nr | head -1
還沒看懂,等興趣來了再研究。。
另外貼一下.py
import os
from os.path import getsize,join,isfile
init=0
filename=''
path=''
for root,dir,files in os.walk('D:/root/root'):
for d in files:
path=join(root,d)
if isfile(path):
if getsize(path)>init:
init=getsize(path)
filename=path
print(filename)
with open(filename,'r') as f:
str=f.read()
print(str)