Saturday, June 30, 2012
5:21 PM

shuf: To shuffle the contents of a file

The command shuf can be used to shuffle the lines of a file passed to it as input.
Example if we have a file,temp, with the following contents

temp:



We can shuffle the lines of the file randomly using shuf.



We can store the output in a new file using the -o option i.e



The output would be written to file temp1.
We can also create a random series of numbers using shuf, by using passing the options -i.



If we want all the numbers in one line and not in different lines we can add the options "-z"


0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.