Questions tagged [linux-disk-free]

NOT FOR USE WITH DATAFRAMES. Use [dataframe] for such questions. df (abbreviation for disk free) is a Unix and Linux command. The df command reports the amount of available disk space being used by file systems.

df (abbreviation for disk free) is a Unix and Linux command. The df command reports the amount of available disk space being used by file systems.

Manpage for df.

85 questions
0
votes
1 answer

df command works in terminal, but not in bash script

I found the code below on a website. I know what it does and understand it, but I can't get it to work correctly. When I run it in Redhat 6.10, I get an error stating, "line 6: [: /: integer expression expected". When I run the df code from the…
Deuce1912
  • 1
  • 1
0
votes
1 answer

df is not included in build/tmp/hosttools

I am using bitbake to build a recipe. One recipe shows it needs df. I checked build/tmp/hosttools df is not there, but I can manually copy df from /bin/df How to config yocto to let it include df tool?
GreenTea
  • 769
  • 1
  • 10
  • 36
0
votes
0 answers

Discrepancy in disk usage

I'm troubleshooting an issue regarding disk size usage in a centOS system (one of the partitions was growing too fast), and I notice one of my directories has 3.1GB: $ du -hs /var/log/mongodb/ 3.1G /var/log/mongodb/ $ df -h…
samthegolden
  • 1,366
  • 1
  • 10
  • 26
0
votes
1 answer

Incorrect used disk space percentage when calculated using Ansible

Can you please tell me why is the percentage of a used drive (disk space) shows 28.5% with ansible while the df -k shows only 19% used on remote Linux host? Here is my playbook code: - name: Generate JSON data set_fact: "{{ ansible_host }}_{{…
Ashar
  • 2,942
  • 10
  • 58
  • 122
0
votes
1 answer

Python Script to compare du and df console outputs

As part of a larger project, I'm currently writing a python script that runs Linux commands in a vApp. I'm currently facing an issue where after working with a mounted iso, it may or may not unmount as expected. To check the mount status, I want to…
0
votes
1 answer

Filesystems, and quota for the home directory and /usr/local on the Google Cloud VM

I created a Debian VM on google cloud. Below is information from "df -h". What are those filesystems, such as tmpfs or /dev/sda1, mean? Any beginner-friendly reference for them? In particular, how much space can I use at my working directory "~",…
zell
  • 9,830
  • 10
  • 62
  • 115
0
votes
3 answers

Add timestamp for each line on the df output command?

I would like to add the date for each line of the df output. I tried: df -m | awk '{print `date +%Y-%m`";"$1";"$2";"$3 }' ... but it doesn't work. How can I add the date?
Ezzmazz
  • 113
  • 5
0
votes
1 answer

How do I add timeout while using fabric for below code?

Code is as below. I will explain here. I use fabric to check the mount point status for 2 server. The command is df -h /mnt The problem of this command is that it may hang there forever, so the fabric code will hang forever. I think some timeout…
Kramer Li
  • 2,284
  • 5
  • 27
  • 55
0
votes
1 answer

Why do I always get 1 for df when running adonis function (permanova)?

I run adonis on community data and environmental matrix (that contains a factor of two levels and 6 continuous variables) using Bray-Curtis and I always take 1 df but this is not the case. Probably there is a bug here. See also the example in adonis…
user1711727
  • 21
  • 1
  • 4
0
votes
1 answer

PERL script to compare partition usage from today's to yesterday's in different hosts using a CSV file

I am new in perl struggling to build my 1st script but, the partition module doesn't work. More details are commented in the code. Maybe the code should be rewritten using hash and reference but I have no idea how to do it. Can someone please, help…
jtech
  • 9
  • 3
0
votes
0 answers

How to get the value for a pattern for a range including the pattern

I'm looking to get all the Filesystem including data to data[1-4], so while using below i only get the value for range specified like data1 to data4, However i'm looking to have data as well. [root@dataserver ~]# df -PH /data[1-4] Filesystem …
krock1516
  • 441
  • 10
  • 30
0
votes
1 answer

How to correctly format df pipe through genmon?

I am having trouble with command output formatting. In terminal this works nicely: df | grep sda1 | head -c33 | tail -c7 | tr -d " " In genmon, I get only numbers such as "1145944": SDAFREE=$(df | grep sda1 | head -c33 | tail -c7 | tr -d "…
chickensk
  • 1
  • 1
0
votes
1 answer

producing df command a grand total specific filesystem

Just need to do some basic thing which I could manage on my own but turned out I have doubt on the result I get... I need to produce a grand total using df command on specific filesystem on two different servers. ssh server1 df -mP | egrep…
emilee
  • 25
  • 7
0
votes
2 answers

display used disk space including reserve disk space in bash

I need show used disk space as (used+reserved),I have created below script and planning to add used and reserved,Is there a better way to do this? I need to display "disk total used available" in this format in GB. #!/bin/sh output=`df -h…
Ek1234
  • 407
  • 3
  • 7
  • 17
0
votes
4 answers

How to strip output of grep?

I'm writing a script which utilises the salt-cli (SaltStack) as well as generic command line arguments to produce a simple HTML-based table outlining all of our servers' Hardware specs and software versions. It's as simple as it sounds, however my…
jto
  • 175
  • 6
  • 21