how to navigate directories in linux

cd command to change directory

One of the common task that you will perform when using the command line interface in Linux, is navigating directories. The Linux file system is hierarchical in nature and the top most directory is called the root and is denoted by the forward slash (/). The command used to change the current working directory is called cd (Change Directory). It…

how to merge two or more directories in linux

rsync examples in linux

Before we merge two or more directories, we need to define what we mean by “merge” in the context of directories. There can be a variety of requirements that could be named as merging of directories. Let’s assume that merging of (two or more) directories means “to create a new directory with files from all of the merged directories“. There…

how to enable and disable ipv6 in linux

linux sysctl config file

IP addresses provide an identification and address to devices in a network so that they can communicate with other devices. These IP addresses need to be unique so that the device can be uniquely identified with in the network. Historically, Internet Protocol (IP) version 4 (or IPv4) was used to assign addresses. As the number of devices and networks on…

how to change encoding in gedit text editor

gedit file open dialog

GEdit is one most popular text editor in Linux desktops. It comes with a whole lot of functionalities. Often times you will need to change the encoding of the file you are viewing in the editor. Many of the editors provide you with the ability to change the file encoding on the fly. We will see how we can change…

how to change desktop wallpaper in kde plasma

As with any self respecting window manager, Plasma (KDE) also give you the ability to set or change wall papers on your desktop. There are several different options when setting wallpaper for your desktop. If you have multiple screens, you can have separate or different configuration for each of your screens or desktops. You can choose to have a static…

kde5: how to restart plasma desktop

kde restart plasma desktop

There are situations when you would want to restart your KDE plasma environment without having to restart the entire system. This maybe because you have compiled a new version of plasma, or your current plasma shell is hanging and is not responding. Whatever the reason might be, you can easily restart your plasma environment if you have access to a…

bash: find last occurrence of a character in a string

linux count characters, words, lines

When writing shell scripts, you usually run into use cases where you want to manipulate text strings. Here we will see how you can find the last occurence of a single character in a string and then use that information to manipulate text or strings. For the purpose of this post, we will consider the character that we can to…

how to count the number of delimiters in a text file in linux

Find common lines in text files

It is easy enough to count lines in a text file, also it is easy enough to count characters with in a text file. So, counting delimiters in the text file should be just as simple. The delimiters are usually nothing but characters and counting those characters will give the count of delimiters in the file. For example, counting lines…

how to delete symbolic links in linux

Symbolic links and symlinks are one of the most popular features of posix based Linux systems. The symbolic links gives you the ability to duplicate files in the system with different names and location with out the need to create copies of the file. There are two different types of links that you can have in Linux: hard links and…

how to delete all empty directories in linux

Linux command line delete files

You might already know that in Linux a directory have to be empty before it can be deleted. Well…not quite true, you can force delete the directories. What if you want to remove only empty directories recursively from the folder structure? There are a couple of different ways to do this. We will see some of the options from the…

linux: how to replace text in file from command line

vi editor and search expressions

Linux has several different utilities that can perform string or text manipulation. Depending on your environment and the tools that are available, you should be able to easily parse, find and replace any string in a text file. Almost every single text editor comes with a find and replace feature with a UI, so we are going to only explore…

how to enable and disable ssh in linux

linux config file for sshd

ssh or secure shell is a network protocol that allows you to perform various network services remotely and securely over an unsecured network. There are several different operations that can be performed using the ssh protocol. The most common are probably logging in or connecting to a remote machine and transferring files over the network to a remote machine. In…