• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

tr command to convert lines to space , tab and vertical tab

October 31, 2014 by Sharad Chhetri

In this post , we are explaining how to use tr command to convert lines or rows to space , tab , vertical tab and vertical tab. In our last post we have explained converting lines to space by using sed command. This time we will use tr command, which translate, squeeze, and/or delete characters from standard input, writing to standard output.

Lets see our sample file called test.

tr command

tr command : convert lines to space

Use the given below command (replace the file path /tmp/test with your target file)

tr 'n' ' ' < /tmp/test

See given below output

tr command

tr command : convert lines to tab

Use the below given command.

tr 'n' 't' < /tmp/test

Below is the output screenshot.
tr command

tr command : convert lines to vertical tab

Vertical tab looks different other than tab. Use the below given command to convert line to vertical tab.

tr 'n' 'v' < /tmp/test

Here is its output.

tr command

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Convert new line to space by using sed command
  2. convert space into new line using sed command
  3. grep command to show lines after and before the keyword
  4. grep command to remove blank lines from file
  5. grep command to remove commented lines
  6. Unix / Linux : How to print duplicate lines from file
  7. df command not showing correct free space in linux
  8. Convert video file into gif file through command line in linux
  9. Convert website page to pdf and image
  10. vi : remove space at beginning and end of each line

Filed Under: Linux Commands Tagged With: linux command

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

yum : how to find rpm package which has certain command or file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

30 useful Linux terminal keyboard shortcuts

Nagios HTTP WARNING: HTTP/1.1 403 Forbidden

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

GNU Screen

How to add/install Ubuntu fonts in CentOS/Red Hat Linux

Set GRUB password after installation of CentOS/Red Hat

Install libjpegtran by using yum command in CentOS 6.x

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy