spark读文件列名字
I maintain an older computer with a small hard drive. I use it mostly for storing MP3s, videos, and other types of basic media. Unfortunately I often get warnings that disk space is low and so I need to delete files I no longer need; i.e. music or movies I have probably grown tired of. I always sort them by size, largest first, so I can find out where the cogs are.
我维护的是一台旧电脑,硬盘较小。 我主要将其用于存储MP3,视频和其他类型的基本媒体。 不幸的是,我经常收到磁盘空间不足的警告,因此我需要删除不再需要的文件。 即我可能已经厌倦的音乐或电影。 我总是按大小排序,最大的优先,所以我可以找出齿轮的位置。
The problem is I try to stick to command line but only know how to do that sorting with human readable format by using Mac's Finder utility. I recent found a command which will output the contents of the current directory and its subdirectories by human readable size:
问题是我尝试坚持使用命令行,但只知道如何使用Mac的Finder实用程序以人类可读的格式进行排序。 我最近发现了一个命令 , 该命令将按人类可读的大小输出当前目录及其子目录的内容:
du -sk -- * | sort -n | perl -pe '@SI=qw(K M G T P); s:^(\d+?)((\d\d\d)*)\s:$1." ".$SI[((length $2)/3)]."\t":e'
That command is kinda gross so you'll probably want to save it as an alias. Nonetheless I now know how to get the desired information from command line!
该命令有点麻烦,因此您可能需要将其另存为别名。 尽管如此,我现在知道如何从命令行获取所需的信息!
翻译自: https://davidwalsh.name/list-files-human-readable-format
spark读文件列名字