Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Delete a "G" character from df -h result Post 303033052 by xnyp on Friday 29th of March 2019 06:56:53 AM
Old 03-29-2019
Delete a "G" character from df -h result

Hello everybody,


I'm a new user in forum,



In a script, i would like that the result sort :
Code:
/usr - 665 Go (free: 631 Go / 6% used)

but i obtain :
Code:
/usr - 665G Go (free: 631G Go / 6% used)

My command line is :
Code:
RES_DF=`df -BG /usr/ | tail -n1 | awk -vOFS='' '{print $5, " - ", $1, " Go (free: ", $3, " Go / ",$4, " used)"}'`

Cause :
DF sort size in GO with the "G" character.

Question :
Do you have an idea for me to get what I want...?


Thank's a lot




Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 03-29-2019 at 08:49 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

2. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

3. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

4. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

5. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

8. Shell Programming and Scripting

Delete characters from each line until meet character ":"

Hello, I have file that looks like this : 765327564:line1 94:line2 7865:line3 ..... 765322:linen I want to cut all the digits from the beginning of each line up to ":" character and to have everything like this : line1 line2 line3 ..... linen P.S : content of line1 ...... (8 Replies)
Discussion started by: black_fender
8 Replies

9. Shell Programming and Scripting

Find "*.c" and "Makefile" and then delete them with one line

find "*.c" and "Makefile" and then delete them with one line (3 Replies)
Discussion started by: yanglei_fage
3 Replies

10. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
GStreamer(1)						      General Commands Manual						      GStreamer(1)

NAME
gst-feedback - generate debug info for GStreamer bug reports SYNOPSIS
gst-feedback DESCRIPTION
gst-feedback is a utility that scans the system for various information that is useful to GStreamer developers to help diagnose user prob- lem. Depending on the type of bug report, it may be useful to attach the output of gst-feeback when you contact the developers. NOTE: The current version of this script scans many dirs: /usr/lib /usr/local/lib /home /usr/include /usr/local/include /home (again) for various GStreamer installations. Depending on your system you may not want to do this. Improvements to the script are welcome. USAGE
Generate the feedback information by running gst-feedback: gst-feedback Possibly redirect output and errors to a file: gst-feedback &> myfeedback WARNING
The gst-feedback dumps a lot of information about a system, some of which may be considered sensitive. If this is a concern, review the information before posting to a public forum, such as the GStreamer bug tracking system. SEE ALSO
gst-launch(1), gst-register(1), gst-inspect(1), AUTHOR
The GStreamer team at http://gstreamer.net/ June 2002 GStreamer(1)
All times are GMT -4. The time now is 11:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy