Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8509629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:29:09+00:00 2026-06-11T03:29:09+00:00

I am having trouble understanding the -c option in tr (Unix command). Looking at

  • 0

I am having trouble understanding the -c option in tr (Unix command).

Looking at this format for tr: tr [Options] set1 [set2]

I understand that -c is an [option] available for tr which means that “it takes the complement of set1 ( aka, all characters not in set1). But, can someone please give an example of how to use this command and explain the benefits.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:29:10+00:00Added an answer on June 11, 2026 at 3:29 am

    It means to complement the character range. When you complement the string A-Z you get Any character that is not in A … Z.

    Sometimes it is much easier to specify a task with the complement. Suppose you want to count the number of semicolons in a C source file. You delete all non-semicolons and count what’s left:

    tr -d -c \; < file.c | wc -c
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having trouble understanding this : why Microsoft put Xattribute under Xobject ? they
from here Im having trouble understanding they say that ado.net does not include a
I am having a little trouble understanding ServiceKnownType in WCF. Taken from this blog
I am having some trouble understanding this brute force approach. I am using Perl
I am having a bit of trouble understanding this bug. Here is the code:
Im having trouble understanding this class and everything ive seen hasn't really helped. Ill
I am having trouble understanding how escaping works inside html tag attribute values that
I am having trouble understanding the difference between these two commands that in my
I'm having trouble understanding routing. Plus I'm trying to understand the resources (and resource)
I am having trouble understanding this java code. I want the image to twinkle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.