Tag Archives: Command

Size of Directories

Get the real file or directory size in unix or linux

All BASH users (Linux, Unix, OSX, etc) use the ls command, but when we want to know how much disk space has been used, the ls command just doesn’t cut it sometimes. While it is a useful command for listing information about files in a directory, or the directory structure, it doesn’t give you the overall space that a directory uses – including the files Read More →

rsync over SSH

Many of us use SSH multiple times on a daily basis times to do simple, complicated, and often redundant tasks. Often times the tasks are those which could be scripted and automated. For instance, if you have to synchronize files with a server often throughout the day, a cron job would be the ideal way because then it will be done automatically and you don’t Read More →

Encrypted Surfing

SSH Tunneling; encrypted surfing with Virtual Hosts

Whether you’re the Secretary of Defense, or just an average Joe trying to survive with some peace of mind and security, encryption is a good thing. Have many virtual hosts on your unencrypted Apache server, but want encryption for whichever virtual host you specify? Here is the solution! Note, this is written for Linux clients – not Windows. You can tweak the instructions to work Read More →

Bootable USB installation disk (instead of CD) from CLI

There’s no reason to use a GUI program to create a bootable USB disk. Use CLI When people download a Linux distribution and wish to install it from a flash disk instead of a CD, some use Unetbootin or similar programs (great programs by the way), but there’s a way to do it via Linux command line that’s just as easy. Follow the steps below: Read More →

Manually clearing the memory cache in Linux

If your Linux based computer is using a lot of memory and you which to clear the memory caches, then rebooting always helps. However, if you don’t want to reboot, luckily, there is a command that will fix this problem. Typically there is nothing to worry about since Linux is very good at handling memory. First off, Linux aggressively uses memory for caching so that Read More →

How to delete files over x days old in *nix

If you have a server with an automated backup system, and you want backups over x days old to be deleted, this is the way you would do it. I use the command in a shell script that is executed every night at midnight – after the backup has been made. rm {} ; executes the removal of the files. There is a space inbetween Read More →

The /etc/skel directory

On *nix servers, you will find a directory at /etc/skel. Anything that is in this directory will automatically be copied and owned for a new user that is added. This is very useful if you are constantly adding new users to a server who are in need of the same directory structure. On another note, if you need to add new users, don’t use the Read More →

Add Users in Unix/Linux/OSX

You can use the useradd command like this: useradd kris BUT, it makes more work. Try the adduser command like this: adduser kris The adduser command has a wizard that guides you through the process of adding users. Make sure you set up the /etc/skel directory first so that the new users will have any files and directories that you wish for them to have.