How can I check disk usage using ssh?

101,177

Solution 1

You can use df -h to see the free space, used space, and total space of all partitions on the system.

Solution 2

Are you wanting to see the disk usage on the SSH remotely? As in, "log in to SSH server and then show the disk usage"?

If so...

ssh user@host "df -h"

That's assuming you have key logins enabled so it doesn't prompt you for a password.

Share:
101,177
Kevin Bowen
Author by

Kevin Bowen

I route the packets that make the Internet sing. Contributor to Xfce Desktop Environment(DE) documentation: https://docs.xfce.org I have been a casual Linux user since Slackware 3.0 (Hello Walnut Creek!) and an Ubuntu user since around version 6.06 or 6.10. My primary professional skill set has been focused on the design, implementation, operation, and daily management of enterprise networks. This includes the configuration and operation of network hardware as well as the care and feeding involved in the network monitoring systems supporting them. The hardware includes routers, switches, firewalls, wan-optimizers, and occasionally load balancers (mostly Cisco, Riverbed, and f5 systems).  Launchpad  twitter

Updated on September 18, 2022

Comments

  • Kevin Bowen
    Kevin Bowen almost 2 years

    We have an ssh server on Ubuntu and we want a disk usage report using ssh of whole network.Is there any utility, command, or script available to accomplish this?

    • Admin
      Admin over 11 years
      Have you considered network monitor services like nagios, zabbix, cacti etc? alternativeto.net/software/nagios/… -- On the other hand, you could set a cron script to email you the data per server (it's much safer, since it doesn't require password or key logins)