Using bash, how can I get the longest line in a file?
$ cat file
12
3241234
123
3775
874
62693289429834
8772168376123
I want to get 62693289429834
.
Using bash, how can I get the longest line in a file?
$ cat file
12
3241234
123
3775
874
62693289429834
8772168376123
I want to get 62693289429834
.
sort -V file | tail -n1
works on your example input. I'm not completely sure it will work on other inputs as well but I think so.