有没有更简洁的方法来使用 zsh 获取 N 个最大文件的 ls -l 类型列表?
Is there a more succinct way to get an ls -l type listing of the N biggest files with zsh?
我百思不得其解
$ for i in **/*(.^oL[1,10]) ; ls -l $i
-rw-r--r-- 1 mscalora staff 82513 Jan 4 14:53 emoji/emoji-data.txt
-rw-r--r-- 1 mscalora staff 72009 Jan 4 14:53 glassfish/_asadmin
-rw-r--r-- 1 mscalora staff 54528 Jan 4 14:53 gitfast/git-completion.bash
-rw-r--r-- 1 mscalora staff 51886 Jan 4 14:53 chucknorris/fortunes/chucknorris
-rw-r--r-- 1 mscalora staff 46593 Jan 4 14:53 emoji/emoji-char-definitions.zsh
-rw-r--r-- 1 mscalora staff 36280 Jan 4 14:53 zsh-navigation-tools/LICENSE
-rw-r--r-- 1 mscalora staff 23433 Jan 4 14:53 pod/_pod
-rw-r--r-- 1 mscalora staff 22757 Jan 4 14:53 history-substring-search/history-substring-search.zsh
-rw-r--r-- 1 mscalora staff 15978 Jan 18 15:56 vault/_vault
-rw-r--r-- 1 mscalora staff 15268 Jan 4 14:53 scala/_scala
一定有更好的方法来做到这一点。
ls
可以接受多个参数。
ls -lS **/*(.^oL[1,10])
我百思不得其解
$ for i in **/*(.^oL[1,10]) ; ls -l $i
-rw-r--r-- 1 mscalora staff 82513 Jan 4 14:53 emoji/emoji-data.txt
-rw-r--r-- 1 mscalora staff 72009 Jan 4 14:53 glassfish/_asadmin
-rw-r--r-- 1 mscalora staff 54528 Jan 4 14:53 gitfast/git-completion.bash
-rw-r--r-- 1 mscalora staff 51886 Jan 4 14:53 chucknorris/fortunes/chucknorris
-rw-r--r-- 1 mscalora staff 46593 Jan 4 14:53 emoji/emoji-char-definitions.zsh
-rw-r--r-- 1 mscalora staff 36280 Jan 4 14:53 zsh-navigation-tools/LICENSE
-rw-r--r-- 1 mscalora staff 23433 Jan 4 14:53 pod/_pod
-rw-r--r-- 1 mscalora staff 22757 Jan 4 14:53 history-substring-search/history-substring-search.zsh
-rw-r--r-- 1 mscalora staff 15978 Jan 18 15:56 vault/_vault
-rw-r--r-- 1 mscalora staff 15268 Jan 4 14:53 scala/_scala
一定有更好的方法来做到这一点。
ls
可以接受多个参数。
ls -lS **/*(.^oL[1,10])