How to use wc, grep and ls to list all files that are at least 10,000,000 bytes in a directory? [duplicate]

Clash Royale CLAN TAG#URR8PPP
This question already has an answer here:
Finding all large files in the root filesystem
3 answers
Now I find that wc -c could show the size of file, then how to select them and list them?
It should be a single pipeline of commands.
command-line wc
marked as duplicate by Kusalananda, Jeff Schaller, Tomasz, αғsнιη, Rui F Ribeiro Feb 11 at 15:21
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Finding all large files in the root filesystem
3 answers
Now I find that wc -c could show the size of file, then how to select them and list them?
It should be a single pipeline of commands.
command-line wc
marked as duplicate by Kusalananda, Jeff Schaller, Tomasz, αғsнιη, Rui F Ribeiro Feb 11 at 15:21
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Also web search
– Kusalananda
Feb 11 at 15:01
Note that usingwcto find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory.
– Kusalananda
Feb 11 at 15:04
Better use the faster "du" command instead of "wc".du -bdoes the same aswc -c(output in bytes).
– Freddy
Feb 11 at 15:08
Related: grep search for any number in a range
– Mark Plotnick
Feb 11 at 17:50
add a comment |
This question already has an answer here:
Finding all large files in the root filesystem
3 answers
Now I find that wc -c could show the size of file, then how to select them and list them?
It should be a single pipeline of commands.
command-line wc
This question already has an answer here:
Finding all large files in the root filesystem
3 answers
Now I find that wc -c could show the size of file, then how to select them and list them?
It should be a single pipeline of commands.
This question already has an answer here:
Finding all large files in the root filesystem
3 answers
command-line wc
command-line wc
edited Feb 11 at 15:21
Rui F Ribeiro
41.1k1480138
41.1k1480138
asked Feb 11 at 14:54
ArTyNKBArTyNKB
11
11
marked as duplicate by Kusalananda, Jeff Schaller, Tomasz, αғsнιη, Rui F Ribeiro Feb 11 at 15:21
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Kusalananda, Jeff Schaller, Tomasz, αғsнιη, Rui F Ribeiro Feb 11 at 15:21
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Also web search
– Kusalananda
Feb 11 at 15:01
Note that usingwcto find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory.
– Kusalananda
Feb 11 at 15:04
Better use the faster "du" command instead of "wc".du -bdoes the same aswc -c(output in bytes).
– Freddy
Feb 11 at 15:08
Related: grep search for any number in a range
– Mark Plotnick
Feb 11 at 17:50
add a comment |
Also web search
– Kusalananda
Feb 11 at 15:01
Note that usingwcto find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory.
– Kusalananda
Feb 11 at 15:04
Better use the faster "du" command instead of "wc".du -bdoes the same aswc -c(output in bytes).
– Freddy
Feb 11 at 15:08
Related: grep search for any number in a range
– Mark Plotnick
Feb 11 at 17:50
Also web search
– Kusalananda
Feb 11 at 15:01
Also web search
– Kusalananda
Feb 11 at 15:01
Note that using
wc to find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory.– Kusalananda
Feb 11 at 15:04
Note that using
wc to find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory.– Kusalananda
Feb 11 at 15:04
Better use the faster "du" command instead of "wc".
du -b does the same as wc -c (output in bytes).– Freddy
Feb 11 at 15:08
Better use the faster "du" command instead of "wc".
du -b does the same as wc -c (output in bytes).– Freddy
Feb 11 at 15:08
Related: grep search for any number in a range
– Mark Plotnick
Feb 11 at 17:50
Related: grep search for any number in a range
– Mark Plotnick
Feb 11 at 17:50
add a comment |
1 Answer
1
active
oldest
votes
find will be better:
find . -type f -size +9999999c
Replace . with the directory.
Modified to also print the file sizes in bytes and sorted by file size (largest files first):find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr
– Freddy
Feb 11 at 15:16
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
find will be better:
find . -type f -size +9999999c
Replace . with the directory.
Modified to also print the file sizes in bytes and sorted by file size (largest files first):find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr
– Freddy
Feb 11 at 15:16
add a comment |
find will be better:
find . -type f -size +9999999c
Replace . with the directory.
Modified to also print the file sizes in bytes and sorted by file size (largest files first):find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr
– Freddy
Feb 11 at 15:16
add a comment |
find will be better:
find . -type f -size +9999999c
Replace . with the directory.
find will be better:
find . -type f -size +9999999c
Replace . with the directory.
answered Feb 11 at 14:59
TomaszTomasz
10.1k53067
10.1k53067
Modified to also print the file sizes in bytes and sorted by file size (largest files first):find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr
– Freddy
Feb 11 at 15:16
add a comment |
Modified to also print the file sizes in bytes and sorted by file size (largest files first):find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr
– Freddy
Feb 11 at 15:16
Modified to also print the file sizes in bytes and sorted by file size (largest files first):
find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr– Freddy
Feb 11 at 15:16
Modified to also print the file sizes in bytes and sorted by file size (largest files first):
find . -type f -size +9999999c -print0 | xargs -0 du -b | sort -nr– Freddy
Feb 11 at 15:16
add a comment |
Also web search
– Kusalananda
Feb 11 at 15:01
Note that using
wcto find the sizes of really big files is just masochism. It would need to read the whole file and count each individual byte. The file size information is already stored as meta-data in the directory.– Kusalananda
Feb 11 at 15:04
Better use the faster "du" command instead of "wc".
du -bdoes the same aswc -c(output in bytes).– Freddy
Feb 11 at 15:08
Related: grep search for any number in a range
– Mark Plotnick
Feb 11 at 17:50