Book Image

CentOS 7 Server Deployment Cookbook

By : Timothy Boronczyk, IRAKLI NADAREISHVILI
Book Image

CentOS 7 Server Deployment Cookbook

By: Timothy Boronczyk, IRAKLI NADAREISHVILI

Overview of this book

CentOS is derived from Red Hat Enterprise Linux (RHEL) sources and is widely used as a Linux server. This book will help you to better configure and manage Linux servers in varying scenarios and business requirements. Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems, and so on. You’ll then see how to secure connection to remotely access a desktop and work with databases. Toward the end, you will find out how to manage DNS, e-mails, web servers, and more. You will also learn to detect threats by monitoring network intrusion. Finally, the book will cover virtualization techniques that will help you make the most of CentOS.
Table of Contents (18 chapters)
CentOS 7 Server Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Viewing the size of files and available storage


Programs and services can behave unexpectedly or stop working entirely when storage space runs tight, so it's important to know how much space is available on our system. This recipe introduces a handful of commands used to determine how large your files and directories are and how much storage is used and is available.

Getting ready

This recipe requires a working CentOS system. Administrative privileges may be needed depending on the permissions of the directories and files you want to inspect.

How to do it...

  • To display the storage capacity of a mounted filesystem, use the df command:

    df -h /
    
  • To view the size of a file, use the ls command:

    ls -sh file.txt
    
  • To determine the size of a directory (the sum of sizes of all of its files), use the du command:

    du -sh ~
    

How it works...

The df command returns information about how much free space is available on a mounted filesystem. The preceding example asked for details about the root filesystem.

df -h...