Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • You may want to take a look at the shuffle command shuf. Commented May 7, 2019 at 15:29
  • @RakeshSharma Could you be more specific? Just running shuf randomizes all the lines, but I want to select just one. Commented May 7, 2019 at 15:44
  • head and tail are other helpful commands in this situation. The Unix philosophy is about combining simple tools to do complex tasks, and head and tail are useful in a wide variety of situations like yours. Commented May 7, 2019 at 16:24
  • Relating unix.stackexchange.com/a/326614/117549 Commented May 7, 2019 at 16:30