How to replace string in file with sed in Linux

If you need to quickly replace a string in a file from Linux command line, ‘sed’ will quickly become one of your best friends.

To replace the string “cloud” with “balkan” in the file demo1.txt

sed -i -- 's/cloud/balkan/g' demo1.txt

You can aswell replace string in multiple files by using any file masks:

sed -i -- 's/cloud/balkan/g' *
sed -i -- 's/cloud/balkan/g' *.txt

 

How to disable swap on Linux

Swap is virtual memory mechanism that can provide additional system operating memory. When the system needs to free up some memory for applications, it temporarily moves data from the RAM to a storage device. Swaping is important for the operating system, but as storage drives are slower than the RAM memory, this process can sometime slow down a system. That’s why sometimes removing swap is neccessary.

Read More

What is Multi-Cloud? How to improve your cloud strategy for 2018

For the past few years cloud computing has made it’s stable grounds in every tech company. With the wider adoption of clouds, the better services and tools and the vast investments in automation and scalability, now it’s time to pay a bit more attention on the quality of the service and end user experience and multi-cloud is the strategic approach that will be the main driving power in 2018.

Read More

Easy live partition resizing on Ubuntu 16.04

Overview

A great benefit of the cloud servers is the easy scaling of resources up and down. But after scaling to a larger cloud machine and acquiring more storage space, you should extend the Linux partitions on it as well as the file system, in order to use that new space.

The tricky part here comes when you want to resize the root partition and some old methods included taking your server off, mounting the storage drive on another Linux machine and resizing the partitions. That of course is very inconvenient in the case of a production server and there are better ways to resize your root partition without having to take it offline.

Read More