특수문자 삭제 (how remove non printable ascii characters file unix)

less than 1 minute read

  • Tested Environment : AIX, HP-UX, SunOS, Linux(RHEL)
tr -cd '\11\12\15\40-\176' < file-with-binary-chars > clean-file
  • octal 11: tab
  • octal 12: linefeed
  • octal 15: carriage return
  • octal 40 through
  • octal 176: all the “good” keyboard characters

출처 : http://alvinalexander.com/blog/post/linux-unix/how-remove-non-printable-ascii-characters-file-unix

Comments