Some important general purpose linux commands

How to get Filesize of a Folder or Directory

If you are looking for a linux command that shows the size of directory/folder then here it is

du -hs –DIRECTORYPATH–

where DIRECTORYPATH is the actual directory path. The possible output of this command will look like

22G –DIRECTORYPATH–

This command is very much helpfull .

Copying file form one location to another location using RSYNC command:

rsync -avz –progress –SRCPATH— –DESTINATIONPATH–

Copying files with excluding a folder from being copied.

rsync -avz –progress –exclude ‘EXCLUDE DIRECTORY’ –SRCPATH— –DESTINATIONPATH–

Naming convention followed below

–SRCPATH— Source Path name

–DESTINATIONPATH– Destination Path name

EXCLUDE DIRECTORY – The directory that you want to get skipped from moving from source folder to destination.

Related posts:

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)