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 8946231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:27:23+00:00 2026-06-15T12:27:23+00:00

I have a formatted list of processes (top output) and I’d like to remove

  • 0

I have a formatted list of processes (top output) and I’d like to remove unnecessary information. How can I remove for example the second word+whitespace of each line.

Example:

1 a hello
2 b hi
3 c ahoi

Id like to delete a b and c.

  • 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-15T12:27:24+00:00Added an answer on June 15, 2026 at 12:27 pm

    You can use cut command.

     cut -d' ' -f2 --complement file
    

    --complement does the inverse. i.e. with -f2 second field was choosen. And with --complement if prints all fields except the second. This is useful when you have variable number of fields.

    GNU’s cut has the option --complement. In case, --complement is not available then, the following does the same:

    cut -d’ ‘ -f1,3- file

    Meaning: print first field and then print from 3rd to the end i.e. Excludes second field and prints the rest.
    Edit:

    If you prefer awk you can do: awk {$2=""; print $0}' file

    This sets the second to empty and prints the whole line (one-by-one).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ArrayList(String) which contains a list of formatted dates like this: element
I have a table with a column ancestry holding a list of ancestors formatted
I would like to have formatted, clickable text and images inside a selected UITableViewCell.
I have a formatted string from a log file, which looks like: >>> a=test
I have a file formatted like this: hello = { a = 2354a b
I have a list of dates formatted as mm/dd/yyyy . In order to fit
I have two long list, one from a log file that contains lines formatted
When I have an unordered list formatted as inline-blocks, the last list element in
I have a list inputList of key value pairs like X,10 X,30 Y,10 I
I have a String which contains formatted Decimal values like 45,890.00, 1.5v 2,12g, etc.

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.