How to show total number of files in folders

Re: Display folder list with numbers of files in each folder and it’s sub folders

If you need to find where you may have large numbers of files stored it is useful to display a list of folders together with how many files are contained within that folder and its subfolders. This enables you to drill down to the area where the most files are stored.

# du -a | cut -d/ -f2 | sort | uniq -c | sort -nr

As an example, I will run this command in my /httpdocs folder, here is the output:

1959 wp-content
424 wp-includes
333 wp-admin
30 img
28 test
22 var

This immediately informs me where the most files are stored and that I have 1,959 files within my wp-content folder and it’s sub folders.

To get the disk usage of these folders instead, do this:

# du -h --max-depth=1

The output is as follows:

98M ./wp-content
4.0K ./plesk-stat
4.0K ./picture_library
20K ./css
128K ./test
5.7M ./wp-includes
3.8M ./wp-admin
8.0K ./blogs
144K ./img
4.0K ./tmp
124K ./var
108M .

These are useful tools when investigating disk space usage problems.

How to list folders with disk usage totals

Re: Show Folders with total disk space used

When finding out where your web space is being used it is useful to be able to list your directories and folders showing total usage for each folder, this allows you to further drill down by concentrating on folders that contain the most usage.

You can perform this task using the du (disk usage) utility:

# du -h --max-depth=1

The output will be in the format as follows:

98M ./wp-content
4.0K ./plesk-stat
4.0K ./picture_library
20K ./css
128K ./test
5.7M ./wp-includes
3.8M ./wp-admin
8.0K ./blogs
144K ./img
4.0K ./tmp
124K ./var
108M .

The -h option shows the usage in human readable form. The –max-depth option ensures we summarise folders in the current directory and not the individual sizes of sub folders.

Plesk 9 SSL Certificate files location

Re: Plesk SSL Location, Where does Plesk store the SSL cert files?

The Plesk Migration Manager does not migrate any stored SSL certificates, you will need to perform this task manually.

/usr/local/psa/var/certificates

In the event of server failure or migration, you can backup the SSL certificates in their raw format and transfer them to the new server.

How to clear/flush the DNS cache?

Still waiting for DNS propagation after 24 hours? It might help to clear your local DNS cache.

Google Chrome:

Navigate to chrome://net-internals/#dns and press the “Clear host cache” button

Internet Explorer:

1) Launch Internet Explorer.
2) Click “Tools” then “Delete Browsing History.”
3) Uncheck “Preserve Favorites website data,” and ensure that “Cookies,” “History” and “Temporary Internet Files” are checked, and then click “Delete.”

Flush your DNS cache on Windows PCs:

Click “Start,” “Run,” type “cmd” into the run text box and then click “OK.”
Type “ipconfig /flushdns” into the command prompt and press “Enter.”

 

Categories DNS

How to resolve “Specifying a character set in HTTP headers can speed up browser rendering”

It is important for a number of reasons why your web site page load speed is as fast as possible. Our previous article “How to speed up your web page load time” explains the importance of the issue.

Increasing your web site performance usually involves a number of small changes to your web page. Some of Google’s PageSpeed suggestions are easier to resolve than others.

The Message:

Google’s PageSpeed reports “The following resources have no character set specified in their HTTP headers. Specifying a character set in HTTP headers can speed up browser rendering.”

The Issue:

Specifying a character set in the HTTP response headers of your HTML documents allows the browser to begin parsing HTML and executing scripts immediately.

The solution:

This is easy if your pages are PHP encoded. Simply add the following line of code to the top of your PHP page:

header(‘Content-type: text/html; charset=iso-8859-1’);

The Result:

Re-run Google PageSpeed and see the warning message vanish!