If you use vi/vim text editor in a terminal with a dark background it may be hard to read some text due to improperly configured color scheme. For example, dark-blue comments on a black background in vi/vim make them almost unreadable. By default, vi/vim is configured to work with a light background, i.e. has a […]
text-processing
Find Out Text File Line Endings – LF or CLRF
A newline (also known as a line ending, end of line (EOL) or line break) is a character used to represent the end of a line of text and the beginning of a new line. Text files created on DOS/Windows machines have different line endings than files created on Unix/Linux. This note shows how to […]
Vi/Vim – Backspace Not Working
If you try to delete characters in the insert mode with the backspace key in vi/vim text editor, this sometimes may not work. Even though this is not a bug but a feature of vi/vim, you may still want to fix a backspace that is “not working”. In this small note i will show how […]
Sublime Text: Install Package (Plugin) – Package Control
Sublime Text is one of the most popular code editors with a lot of built-in features. The functionality of Sublime Text can be extremely extended by hundreds of useful plugins. The easiest way to install a package (plugin) for Sublime Text is to use Package Control – the package manager for Sublime Text.
Vi/Vim – Arrow Keys Don’t Work – Print Letters in Insert Mode
By default, vi/vim text editor uses the h, j, k and l keys for navigation. Hitting arrow keys in the insert mode will insert newlines and print A, B, C, D capital letters. In this small note i will show how to fix not working arrow keys, that print letters in the insert mode in […]
RegEx: Find IP Addresses in a File Using Grep
Here are some regular expressions that will help you to perform a validation and to extract all matched IP addresses from a file. The following regular expressions match IPv4 addresses. Matched IP addresses can be extracted from a file using grep command. In this article you’ll find a regular expressions themselves and an example of […]
SED/AWK – Add to the End or Beginning of a Line
From time to time it is required to modify some file very fast. And it goes without saying that the most popular command line tools for this in Linux are sed and awk – the two best text processing programs. In the following article, you’ll find an information about how to add some text, character […]
RegEx: Find Email Addresses in a File using Grep
Here is a best regular expression that will help you to perform a validation and to extract all matched email addresses from a file. This regular expression matches 99% of the email addresses in use nowadays. In this article you’ll find a regular expression itself and an example of how to extract matched email addresses […]
Removing First and Last Characters From Strings in Bash
From the following article, you’ll learn how to remove first characters from the beginning of each line in Bash and how to print strings between first and last characters using cut command. You’ll also learn how to remove last characters of each line using trick with reverse command. I’ve created a file with the following […]
AWK: Print Column – Change Field Separator – Linux Bash
The awk is a powerful Linux command line tool, that can process the input data as columns. In the following note i will show how to print columns by numbers – first, second, last, multiple columns etc. I will show how to change the default field separator in awk. At the end of this article […]