Currently Browsing: Bash / SSH

Delete files older than X nuber of days

Here is another bash one-liner. This one will help you find and delete files older than X number of days. Very useful in a directory full of various types of logs, such as /var/log: find .  -type f -mtime +X -exec rm -rf {} \; ;done This assumes, that you are already in the directory in question. Simply...

remove only old files from a folder

If you have a directory full of logs for example, I am sure at some point you needed to delete all of them, but the 10 most recent ones. Here is a very short bash one-liner: rm `ls -t | awk 'NR>10'` This will remove all the files from the folder and will leave the 10 most recent ones. The command...

Virtual FreeBSD part 2: Installing the BASH shell.

This is the second part of the “Virtual FreeBSD” tutorials series. In the first part we have installed the OS from the scratch by downloading most of it from the Internet. In this second tutorial we will customize the default shell and install a little bit more user-friendly one. But first...

openvpn and a Windows client

This is quite an easy one. Even for a newbie. Here we will show the quickest way to create an openVPN tunnel between your safe home Linux/BSD router and your Windows client. Very useful for mobile computers, which do not always use the same secure network. Mind that this only shows you the quickest way...

Adding ssh keys automatically

Top Solution of the day: SSH keys are very useful for people who work with multiple servers every day. How do keys work: Simply, you generate yourself a key: ssh-keygen -t dsa -C “Comment-goes-here” The ssh-keygen is an application that generates and manages authentication keys. You can see...