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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:12:27+00:00 2026-06-07T15:12:27+00:00

I am trying to make a very simple shell script that frees up some

  • 0

I am trying to make a very simple shell script that frees up some memory space. For this, I am using command

$ ps xopmem o%c

to output a list of running processes with its percentual memory usage. Now, I want to filter out only those lines whose value (in the first field) is larger than, say 5.0. How can I do that? I preferably use SED.

P.S.: I Googled around this topic on the Internet but found nothing. Any help will be appreciated.

  • 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-07T15:12:30+00:00Added an answer on June 7, 2026 at 3:12 pm

    sed cannot do numerical comparisons, you need to move one tool up, i.e. awk:

    ps xopmem o%c | awk '$1 > 5.0'
    

    That is, when the first field is greater than 5, execute the default block: { print $0 }.

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

Sidebar

Related Questions

I'm trying to make a very simple asp.net page that binds a GridView using
I'm trying to modify this very simple shell script I wrote to check if
I'm trying to make a very simple updater app that reads current version.txt file
I'm learning Objective-C and trying to make a very simple command line calculator. 'S'
I've been trying to make a parser for a (very) simple language that looks
I was trying to make a tail-recursive version of this very simple SML function:
I have a very simple problem. I'm trying to make an ajax call using
I'm trying to make a very simple iphone app that displays the real-time camera
I'm trying to make a very simple 'counter' that is supposed to keep track
I am currently trying to make a very simple C program for school that

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.