objectif
Tester aléatoirement, splitter datasets, ou générer des ordres aléatoires.
code minimal
# échantillon de 100 lignes
shuf -n 100 data.txt > sample.txt
utilisation
# seed fixe pour reproductibilité
shuf --random-source=<(yes 42 | tr -d '\n') -n 10 list.txt
variante(s) utile(s)
# mélanger un range
shuf -i 1-10
notes
--random-sourcepermet un seed custom.- combinez avec
splitpour cross-validation.