Disk space usage command line

Quite often, after a computer or laptop has been used for a while, we may need to know what is taking up all of the hard drive space.

An open source command-line utility called ‘du’ allows us to check file and directory sizes.

Here is a little snippet to check the size of the items in the present wording directory (also known as `pwd` ).

du -hs ./*|grep ^\.*[0-9]\.[0-9]*G\.*$|sort -n

You should now have a list of files and folders that are 1 Gigabyte or greater in size.

Imapsync migration from Zimbra to Kerio

If you are setting up a new Kerio mail server and want to use imapsync to port across your emails, this following command helps to re-locate your email folders from the existing server into a nice way on your tidy new Kerio server.

imapsync –syncinternaldates –subscribe –ssl1 –ssl2 –authuser1 admin –user1 user1 –passfile1 /home/user1/.passwordfile –user2 olduser1 –passfile2 /home/user1/.oldpasswordfile –sep2 / –prefix2 “INBOX/” –nofastio1 –nofastio2

That should nicely transfer all existing emails into their respective folders underneath your new Kerio Inbox folder.

replace admin; user1; user2; /home/user1/{.passwordfile, .oldpasswordfile} with your details.