Rsync examples in Linux

Rsync examples in Linux

rsync stands for “remote sync” and is a powerful command line utility for synchronizing directories either on a local system or with remote machines. It’s built into nearly every Linux system by default and this tutorial will help you to understand rsync better by providing you most common rsync examples administrators use to keep the data synchronised across multiple server/hosts.

Some users mistakenly think of rsync as a file copying tool, like cp or scp.While there’s some overlap, rsync excels in synchronization, specifically. In other words, it can take a source directory and make an identical destination directory.

Read more

NFS vs SAMBA vs CIFS

NFS vs SAMBA vs CIFS

NFS, SAMBA, and CIFS are three different terms that get thrown around a lot whenever someone mentions file sharing between two or more systems. But, do you know what these three implementations do, and how they do it differently from one another? For some reason these technologies remain in a shroud of mystery to even some seasoned system administrators.

Read more

Configuring a USB drive to mount automatically in Linux

Automatically mount USB external drive

The default behavior of most Linux systems is to automatically mount a USB storage device (such as a flash drive or external drive) when it gets plugged into the computer. However, this is not the case across every distro, or sometimes configurations go awry and you may find that your device is not being automatically mounted. You may also just want your storage device to mount when you plug it in before booting.

Read more

Backing up file permissions on Linux

Backup permissions on Linux

If you’re worried about the file permissions on your Linux system being changed, it’s possible to back up the file permissions of a certain set of files or directories with the getfacl command. You can then restore file permissions en masse by using the setfacl command.

In this guide, we’ll show how to make a backup snapshot of file permissions, as well as how to restore the saved permissions.

In this tutorial you will learn:

  • How to create a backup of file permissions
  • How to restore a backup of file permissions

Read more

Configuring a VirtualBox shared folder

How to configure shared VirtualBox folder on Linux

After installing a Linux distro into a VirtualBox virtual machine, you may be wondering how to share files between the host operating syste and the virtual machine itself. One of the easiest and most convenient ways to provide this function is by setting up a VirtualBox shared folder.

Essentially this means that a folder on your host machine can be mounted on the virtual machine, where both systems will be able to access files or drop them in the folder. It doesn’t matter what host operating system you’re using, as the instructions will be the same across Linux, Windows, etc.

In this guide, we’ll go through the step by step instructions to configure a shared VirtualBox folder. We’ll also show you how to mount the shared folder on your Linux system, allowing you to easily share files back and forth.

In this tutorial you will learn:

  • How to configure a shared VirtualBox folder on Linux
  • How to mount a VirtualBox shared folder

Read more

USB stick encryption using Linux

USB stick encryption using Linux

If you were to ever lose your USB stick, all data stored on it will be lost. More importantly, your USB stick may end up in the hands of some other person, which will have access to your private files, and use that information in any way they please. This is one of many fears of USB stick users. One of the simplest solutions to this dilemma is to keep only non-private information on the USB stick. Obviously, this would defeat a primary purpose for the storage device.

Another solution is to encrypt your USB stick so it will be accessible only to those users who possess the correct password which will fit to decrypt the USB stick’s encryption. This article will deal with the second solution and that is encryption of a USB stick device. Although encrypting an USB stick seems to be the best and easiest solution, it must be said that it also comes with number of disadvantages. The first disadvantage is that decryption of the USB key must be done using a Linux system that has the dm-crypt module installed.

In other words, you cannot use your encrypted USB stick on any Windows machine and UNIX-like system with older kernels. Therefore, to encrypt only a part of the USB stick which holds only private information seems to be a good solution. In this article, we will go through the step by step instructions of encrypting part of a USB device on Linux. Read on to see how it’s done.

In this tutorial you will learn:

  • How to install cryptsetup on major Linux distros
  • How to partition a USB stick
  • How to encrypt a USB stick partition
  • How to mount encrypted partition

Read more

Recovering deleted files from a FAT filesystem on Linux

Data recovery of deleted files from the FAT filesystem

Although FAT32 or FAT16 are very old file systems, which is reflected in their poor performance in comparison to other file system alternatives, they are still widely used by many electronic devices. Usually, these devices include USB sticks, digital cameras, camcorders and other peripheral storage devices.

There’s a good chance that you own and store personal data on a device with the FAT filesystem. If you accidentally delete important data from the device, we’ve got good news for you: it can be recovered on Linux.

In this guide, we’ll go over the step by step instructions to recover deleted data from the FAT filesystem on Linux. Read on as we use the testdisk command to perform file recovery.

In this tutorial you will learn:

  • How to create a low level backup of FAT filesystem
  • How to install testdisk tool on major Linux distros
  • How to use testdisk to recover deleted files from FAT

Read more

Retrieving and setting a new UUID for a partition on Linux

How to retrieve and change partition’s UUID Universally Unique Identifier on linux

Hard drive partitions on Linux systems rely on a UUID (universally unique identifier) for unique labels. This is basically a unique string of characters that the operating system will use to identify your hard disk partitions and other storage components.

You can see this for yourself by examining the /etc/fstab file on your own system.

$ grep UUID /etc/fstab

In this guide, we’ll go over several command line methods to retrieve the UUIDs of hard disk partitions. We’ll also show you how to generate UUIDs and change a partition’s UUID.

In this tutorial you will learn:

  • How to retrieve, generate, and change the UUID of a partition

Read more

Adding Windows 10 to GRUB boot menu

Booting a MS Windows OS using GRUB

Configuring a computer as dual boot system is a popular solution for users that wish to use Linux and Microsoft Windows on the same device. However, getting the two operating systems to share the same computer can be a bit tricky. In particular, Windows has its own boot loader and Linux uses GRUB. It’s easiest to have a dual boot system when GRUB is used as the boot loader, as it can be easily configured to boot into Windows as well as Linux.

In this guide, we’ll go through the step by step instructions to add Windows 10 to the GRUB menu. This way, you can select between Windows and your installed Linux distro when the computer first boots up. This guide assumes that you’ve already installed Linux and Windows on the same computer, and simply need to add Windows as an option to your GRUB menu.

In this tutorial you will learn:

  • How to add Windows to GRUB boot menu

Read more

Using CurlFtpFS to mount remote FTP directories on Linux

Mount remote ftp directory host locally into linux filesystem

Do you often access your ftp site to make some simple changes or to share some documents that you wish to be accessible from anywhere?

You can make access to your ftp resource easier with the CurlFtpFS Linux utility. This fantastic utility allows you to mount your ftp site to any directory within your Linux filesystem.

In this guide, we’ll go over the installation of CurlFtpFS on major Linux distros, then cover the step by step instructions to configure it.

In this tutorial you will learn:

  • How to install CurlFtpFS on major Linux distros
  • How to mount remote FTP directory using CurlFtpFS
  • How to mount an FTP directory automatically with /etc/fstab

Read more

Replacing all tab characters with spaces on Linux

Replace all TAB characters with spaces

If you have a lot of tab characters inside a text document or program file, they can be annoying because of how they’re represented differently in various text editors. For example, when you send your code to someone else, is it going to display the same way on their screen as it did on yours? Tabs are a bit unpredictable in this respect, and spaces are a much safer bet.

In this guide, we’ll show how to replace all the tab characters inside a file with spaces on Linux. We can use various Linux commands to do the job for us, which we’ll go over below. Depending on your situation and the file in question, some commands may be more suitable than others.

In this tutorial you will learn:

  • How to replace tab characters with spaces

Read more