Website Performance - We can Help - Merkados
Website Design Promo

List Folders and Subfolders in order of File Size in Bash

February 15th, 2021 admin

This is the command in bash that you would need to list the folders and subfolders of a directory in order of file size. This is useful because you may need to know in what directory you have bigger files – for example when trying to delete old big emails.


/* Command to enter in Bash*/
du -h --max-depth=1 2> /dev/null | sort -n -r | head -n20
/*End of Code*/

How to get the MX records of a Domain

April 27th, 2020 admin

Quick little post. You may need to know the MX DNS record of a domain in order to know what server handles the communications. You can find out via terminal (BASH). Here is how:

dig mx +short

That’s it folks – until next time.

Search / Find files modified in the last x days with Bash in Terminal

March 13th, 2020 admin

So, if you are like me, sometimes for any number of reasons, you have to find all the files of a certain type that have been modified lately. For example, if a client had a security problem with their website and you would like to check what files where modified since the last backup. Or let’s say that you don’t remember what files you modified the last time that you made some changes to a directory, etc.

Read the rest of this entry »

The easy tutorial of Rsync to “SYNC” two folders and its contents.

January 19th, 2019 admin

If you are looking for a solution to syncing two folders, whether it’s over a network or locally, this is how you do it.

In my opinion this is a very valuable specially when you have media files that are very important to you and you want to lose them.

The RSYNC command

The -a flag means “archive” which in turn means recursive and preserving symbolic links, ownership and permissions. In general, it is more likely to use -a than to use -r (recursive).

rsync -a sourceDir/ destinDir

The -n variable is meant as a test “dry-run” and so no actual changes are made. -v is Verbose.

rsync -anv sourceDir/ destinDir

The -z flag compresses the network transfer reducing the size of the transfer as much as possible. The -P flag combines –progress (progress bar) and –partial (to resume interrupted transfers).

rsync -azP sourceDir/ destinDir

The –delete flag deletes the files in the destination that have been removed in the source. Therefore keeping a true sync between both directories. Ideally run it with -nv flag first to make sure that is to be removed is what you want.

rsync --delete sourceDir/ destinDir


So in summary you want to use this to Sync two directories:

1. Run it as a test.

rsync -anv sourceDir/ destinationDir

2. Ready? Run it.

rsync -azPv sourceDir/ destinationDir

3. If the sync has been there before, and so now is truly about syncing the two directories then use:

rsync -azPv --delete sourceDir/ destinationDir

Note: If you use a slash at the end of the first directory, then it means: “The contents of sourceDirectory” but not the directory itself. On the other hand if you ommit the use of the slash in the sourceDirectory then it means: “The content of the sourceDirectory but also the SourceDirectory/ itself”.

Thanks again.

Setup a Git Repository in your VPS

November 6th, 2016 admin

When I was new to the whole version control scene, I wanted to jump in the wagon with both feet and really start using GIT. The problem was that it is not as easy as people make it sound. I was confused with figuring out what a repository meant, what pushing, clone and all sorts of problems that a beginner may have. And the problem is that the documentation available was also a bit technical and difficult to read. That’s why I wanted to explain it here. Now, my personal challenge was that since I have access to a VPS via SSH, I didn’t want to necessarily pay for a private repository if I didn’t have to. And since I was beginning to use git, I really didn’t need a great account with Github or something along those lines.

The other challenge is that I wanted my repository to be available everywhere but also to be private to me. I wanted to be the only one to access it. The reason is that sometimes I am out of the country, and I would love to be able to simplify the process of working remotely in projects and keeping them on a VPS repository.

Read the rest of this entry »

Moving a cPanel acount from host to host

January 28th, 2014 admin

So, for this post, I am going to assume that you are having some trouble moving a cPanel account from one server to another. Usually, the problem is because certain hosting companies modify the cPanel installation and therefore once you create a backup – it doesn’t work.

This steps are going to reduce the time that you would waste trying to figure it out on your own. Read the rest of this entry »

cPanel Erase Emails older than X amount of days – Tutorial

October 18th, 2012 admin

If you are a Linux admin and you would like to delete emails from a particular cpanel account without having to do it manually, you would do so directly via SSH.

The Problem:

The problem is that sometimes you want to only delete the emails that have some longevity. In other words, you may desire to delete only those emails that are older than x number of days. So how do you do that?
Read the rest of this entry »

Remove Mailman’s Archive – Reduce Account Disk Space

September 24th, 2012 admin

Sometimes you may run into a situation where a Mailman mailing list is keeping either public or private archives of your messages and therefore you’ll eventually run into an interesting problem:


Because Mailman has been keeping an archive of every message, image and email content that has been used in the list, that means that eventually that archive will be enormous, or at least big enough to make you want to delete it. How do you go about doing that? You can spend hours trying to find the right answer in Google and testing what works and what doesn’t or you can bypass all that and jump into the answer! Here it is:

Read the rest of this entry »