Categories
Linux Useful

du – Get the Size of a Folder in Ubuntu Linux

The linux du command displays the size of file space used by the specified files or folders. If the specified path is a directory (folder), du summarizes disk usage of each subdirectory in that directory. Otherwise, du reports the disk usage of the current working folder. To get the total size of the /srv folder, […]

Categories
PHP Useful

Gets the current working directory in PHP

using getcwd() – gets the current working directory – php function echo getcwd(); using dirname() php function echo dirname(__FILE__); echo dirname($_SERVER[PHP_SELF]); using basename() php function  – (PHP5+) echo basename(__DIR__) so if you want to use a file with require_once, include or require, the usage syntax can be the following: require_once dirname(__FILE__) . ‘/folder/script.php’;

Categories
Linux Useful

View the file size of a directory in LINUX – Folders and Subfolders

If we want to see what is the size occupied by folders or subfolders in linux, we can use the du command, that is a command line utility for reporting file system disk space usage. It can be used to find out disk usage for files or folders and to show what is taking up […]