mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Added shuf notes to the knowledge base
This commit is contained in:
17
knowledge base/shuf.md
Normal file
17
knowledge base/shuf.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Shuf
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# randomize the order of lines in a file and output the result
|
||||||
|
shuf filename
|
||||||
|
|
||||||
|
# only output the first 5 entries of the result
|
||||||
|
shuf -n 5 filename
|
||||||
|
|
||||||
|
# write output to another file
|
||||||
|
shuf filename -o output_filename
|
||||||
|
|
||||||
|
# generate random numbers in range 1-10:
|
||||||
|
shuf -i 1-10
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user