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

  • Home
  • SEARCH
  • 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 6359543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:31:55+00:00 2026-05-24T23:31:55+00:00

Is there a way to specify multiple spaces as a field delimiter with the

  • 0

Is there a way to specify multiple spaces as a field delimiter with the cut command (something like a " "+ regex)? For example, what field delimiter I should specify for the following string to reach value 3744?

$ps axu | grep jboss

jboss     2574  0.0  0.0   3744  1092 ?        S    Aug17   0:00 /bin/sh /usr/java/jboss/bin/run.sh -c example.com -b 0.0.0.0

cut -d' ' is not what I want, because it’s only for a single space. awk is not what I am looking for either, so how to do this with cut?

  • 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-05-24T23:31:56+00:00Added an answer on May 24, 2026 at 11:31 pm

    Actually awk is exactly the tool you should be looking into:

    ps axu | grep '[j]boss' | awk '{print $5}'
    

    or you can ditch the grep altogether since awk knows about regular expressions:

    ps axu | awk '/[j]boss/ {print $5}'
    

    But if, for some bizarre reason, you really can’t use awk, there are other simpler things you can do, like collapse all whitespace to a single space first:

    ps axu | grep '[j]boss' | sed 's/\s\s*/ /g' | cut -d' ' -f5
    

    That grep trick, by the way, is a neat way to only get the jboss processes and not the grep jboss one (ditto for the awk variant as well).

    The grep process will have a literal grep [j]boss in its process command so will not be caught by the grep itself, which is looking for the character class [j] followed by boss.

    This is a nifty way to avoid the | grep xyz | grep -v grep paradigm that some people use.

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

Sidebar

Related Questions

Is there a way to specify using JPA that there should be multiple unique
Is there an easier way to specify multiple System Properties on the command line
Is there any way to specify that a function should be called when a
Is there a way to specify which namespace includes should be automatically added any
Is there a way to specify pretty-print-like formatting around HTML tags? I want to
Is there a way to specify actions like <copy> in an Ant buildfile that
Is there a way to specify, for example 4 distinct values for a varchar
I want to know if there is a way to specify that in multiple
Is there a way to specify multiple input files for a hadoop job? I've
According to the Android online docs there's currently no way to specify multiple/mixed file

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.