2021-11-04 13:29:13

This commit is contained in:
gbaconni
2021-11-04 13:29:13 +01:00
parent 81157a4ccb
commit fb6c57240d
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/04 10:58:16 by gbaconni #+# #+# #
# Updated: 2021/11/04 13:25:57 by gbaconni ### lausanne.ch #
# Updated: 2021/11/04 13:26:47 by gbaconni ### lausanne.ch #
# #
# **************************************************************************** #

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/04 12:36:53 by gbaconni #+# #+# #
# Updated: 2021/11/04 13:16:06 by gbaconni ### lausanne.ch #
# Updated: 2021/11/04 13:29:12 by gbaconni ### lausanne.ch #
# #
# **************************************************************************** #
@@ -25,13 +25,13 @@ ft_cpu ()
ft_memory ()
{
free -m | awk '/Mem:/ { total=$2; used=total-$3; } END { printf "#Memory Usage: %d/%dMB (%.2f%%)\n" used, total, (used * 100) / total; }'
free -m | awk '/Mem:/ { total=$2; used=total-$3; } END { printf "#Memory Usage: %d/%dMB (%.2f%%)\n", used, total, (used * 100) / total; }'
}
ft_disk ()
{
df --total -l -t ext2 -t ext3 -t ext4 -t xfs \
| awk '/^total/ { total=$2; used=$3; pcent=$4 } END { printf "#Disk Usage: %d/%dGb (%.2f%%)\n" used * 8, (total * 8) / (1000 * 1000 * 1000), pcent; }'
| awk '/^total/ { total=$2; used=$3; pcent=$4 } END { printf "#Disk Usage: %d/%dGb (%.2f%%)\n", used * 8, (total * 8) / (1000 * 1000 * 1000), pcent; }'
}
main ()