Sponsored Content
Top Forums Shell Programming and Scripting How to read total RAM in GBs? Post 303025871 by apmcd47 on Wednesday 14th of November 2018 07:33:58 AM
Old 11-14-2018
Quote:
Originally Posted by mohtashims
I am aware of the commands to find the total RAM on Linux and Unix for example vmstat.

Can you please tell me which tool / command can give me the Total RAM reading in GBs [gigabytes] on Solaris Unix and Linux ?
There is a tool on Linux called numfmt:
Code:
$ wc -c < myfile | numfmt --to=iec
34M

Unfortunately it is not on Solaris to my knowledge. It is, however, part of the Gnu coreutils, so it may be possible to compile it from source.

Andrew
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Total ram

Hi How can i find the total ram in the system? :confused: (4 Replies)
Discussion started by: orca
4 Replies

2. HP-UX

How should I know the total RAM available on UNIX

Hi How Should I know the Total RAM available on HP-UX box? (7 Replies)
Discussion started by: skull123
7 Replies

3. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies

4. Shell Programming and Scripting

View the Server Total Ram in GB

Hello, I want to view server RAM in GB i.e 4 GB or 6 GB via command line to use it in bash script waiting Any Ideas :) Thanks :):) (2 Replies)
Discussion started by: LinuxCommandos
2 Replies

5. Red Hat

red hat Linux 5.0 is detecting 3gb ram but physical ram is 16gb

Hi, On server 64bit Hw Arch , Linux 5.0(32bit) is installed it is showing only 3gb of ram though physical is 16gb can u give me idea why? (4 Replies)
Discussion started by: manoj.solaris
4 Replies

6. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

7. Emergency UNIX and Linux Support

Grab total page read from webalizer display in html

Hi, I need a way to grab the total combines since inception, total pages read from webalizer on my centos server or any other location (as long as since inception) and display the result live on my website So with each visit it would be increasing, or perhaps live (ajax) not sure But can... (0 Replies)
Discussion started by: lawstudent
0 Replies

8. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

9. UNIX for Dummies Questions & Answers

Total RAM not recognised

Hi We have a redhat 4 with 8GB ram in it but free -m only recognises 3 GB of total ram please could some one help me why this happens HP syetems insight manager showing 4* 2 GB RAMS # free -m total used free shared buffers cached Mem: 3290... (6 Replies)
Discussion started by: robo
6 Replies
NUMFMT(1)							   User Commands							 NUMFMT(1)

NAME
numfmt - Convert numbers from/to human-readable strings SYNOPSIS
numfmt [OPTION]... [NUMBER]... DESCRIPTION
Reformat NUMBER(s), or the numbers from standard input if none are specified. Mandatory arguments to long options are mandatory for short options too. --debug print warnings about invalid input -d, --delimiter=X use X instead of whitespace for field delimiter --field=N replace the number in input field N (default is 1) --format=FORMAT use printf style floating-point FORMAT; see FORMAT below for details --from=UNIT auto-scale input numbers to UNITs; default is 'none'; see UNIT below --from-unit=N specify the input unit size (instead of the default 1) --grouping use locale-defined grouping of digits, e.g. 1,000,000 (which means it has no effect in the C/POSIX locale) --header[=N] print (without converting) the first N header lines; N defaults to 1 if not specified --invalid=MODE failure mode for invalid numbers: MODE can be: abort (default), fail, warn, ignore --padding=N pad the output to N characters; positive N will right-align; negative N will left-align; padding is ignored if the output is wider than N; the default is to automatically pad if a whitespace is found --round=METHOD use METHOD for rounding when scaling; METHOD can be: up, down, from-zero (default), towards-zero, nearest --suffix=SUFFIX add SUFFIX to output numbers, and accept optional SUFFIX in input numbers --to=UNIT auto-scale output numbers to UNITs; see UNIT below --to-unit=N the output unit size (instead of the default 1) --help display this help and exit --version output version information and exit UNIT options: none no auto-scaling is done; suffixes will trigger an error auto accept optional single/two letter suffix: 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, si accept optional single letter suffix: 1K = 1000, 1M = 1000000, ... iec accept optional single letter suffix: 1K = 1024, 1M = 1048576, ... iec-i accept optional two-letter suffix: 1Ki = 1024, 1Mi = 1048576, ... FORMAT must be suitable for printing one floating-point argument '%f'. Optional quote (%'f) will enable --grouping (if supported by cur- rent locale). Optional width value (%10f) will pad output. Optional negative width values (%-10f) will left-pad output. Exit status is 0 if all input numbers were successfully converted. By default, numfmt will stop at the first conversion error with exit status 2. With --invalid='fail' a warning is printed for each conversion error and the exit status is 2. With --invalid='warn' each con- version error is diagnosed, but the exit status is 0. With --invalid='ignore' conversion errors are not diagnosed and the exit status is 0. EXAMPLES
$ numfmt --to=si 1000 -> "1.0K" $ numfmt --to=iec 2048 -> "2.0K" $ numfmt --to=iec-i 4096 -> "4.0Ki" $ echo 1K | numfmt --from=si -> "1000" $ echo 1K | numfmt --from=iec -> "1024" $ df | numfmt --header --field 2 --to=si $ ls -l | numfmt --header --field 5 --to=iec $ ls -lh | numfmt --header --field 5 --from=iec --padding=10 $ ls -lh | numfmt --header --field 5 --from=iec --format %10f GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report numfmt translation bugs to <http://translationproject.org/team/> AUTHOR
Written by Assaf Gordon. COPYRIGHT
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for numfmt is maintained as a Texinfo manual. If the info and numfmt programs are properly installed at your site, the command info coreutils 'numfmt invocation' should give you access to the complete manual. GNU coreutils 8.22 June 2014 NUMFMT(1)
All times are GMT -4. The time now is 12:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy