How can I remove CRLF line terminators from wget'ed file?

10,353

Use tr to remove them:

wget http://pastebin.com/raw.php?i=LBVNiRXa -O- | tr -d '\r' >somefile
Share:
10,353

Related videos on Youtube

Tiago Carrondo
Author by

Tiago Carrondo

I've been using Ubuntu since BreezyBadger. Proud member of the Portuguese LoCoTeam.

Updated on September 18, 2022

Comments

  • Tiago Carrondo
    Tiago Carrondo over 1 year

    I want to download a pastebin a raw file, and I tried:

    wget http://pastebin.com/raw.php?i=LBVNiRXa -O somefile
    

    My only problem is that the file arrives with CRLF line terminators.

    Can I remove the line terminators with only one command line?

  • Fr0zenFyr
    Fr0zenFyr over 7 years
    Million Thanks!! My head was about to explode, wasted almost an hour on this trivial issue!