Instead of using the predefined [:cntrl:]
set, which as you observed includes \n
and \r
, just list (in octal) the control characters you want to get rid of:
$ tr -d '\000-\011\013\014\016-\037' < file.txt > newfile.txt
More Related Contents:
- What killed my process and why?
- How to set the environmental variable LD_LIBRARY_PATH in linux
- How do I write standard error to a file while using “tee” with a pipe?
- Using openssl to get the certificate from a server
- Linking OpenSSL libraries to a program
- What is an uninterruptible process?
- how to create docker overlay network between multi hosts?
- BlueZ: How to set up a GATT server from the command line
- Using grep to get the next WORD after a match in each line
- How to create a file with a given size in Linux?
- How to get the process ID to kill a nohup process?
- What is a .pid file and what does it contain?
- using awk with column value conditions
- Run text file as commands in Bash
- How to find all files containing specific text (string) on Linux?
- How can a process intercept stdout and stderr of another process on Linux?
- Chmod 777 to a folder and all contents [duplicate]
- Multithreading in Bash [duplicate]
- Difference between shell and environment variables
- Why crontab uses OR when both day of month and day of week specified?
- Linux Mach-O Disassembler
- How clear and invalidate ARM v7 processor cache from User Mode on Linux 2.6.35
- Execute combine multiple Linux commands in one line
- How to pass parameters to a Bash script?
- NuGet on Linux: Error getting response stream
- Signed executables under Linux
- How can I make R read my environmental variables?
- find and delete file or folder older than x days
- Add a newline only if it doesn’t exist
- Need text to speech and speech recognition tools for Linux