• 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 Leave a Comment

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. Linux enable or disable multiple swap space

Filed Under: Linux Commands Tagged With: linux command

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Linux Commands

awk command to print columns from file

rsync over ssh port number on Linux/Unix system

Find exit status code of last executed command on Linux and Unix

Jpeg Image Optimization / Compress on Linux

grep command to show lines after and before the keyword

Linux : clear command and its keyboard shortcut

Install lxml by using pip command on Ubuntu 14.04 LTS

Explore 70+ Articles On Linux Commands

Always Useful Tips And Tricks

Install libjpegtran by using yum command in CentOS 6.x

This kernel requires an x86-64 CPU but only detected an i686 CPU

Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd’!

Forgot root password ,Reset it in Run level 1

Print double hyphen sign simultaneously in post of Octopress

Error installing rails

How to change hostname in Ubuntu 12.04 and 12.10 without system restart

Explore 90+ Article On "Linux Tips And Tricks"

You Might Like These Articles!

Internal External Command

What is Linux/Unix Internal And External Command

Linux basic command

Linux Basic Commands For Every Beginner

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)

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission but Schools and Colleges can do in their Private Network
Proudly Blogging From Bharat.

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