How to install PHP 7.2 on Ubuntu

sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install -y php7.2 Set PHP5.6 as default version: $ sudo update-alternatives –set php /usr/bin/php5.6 Alternatively, you can run the following command to set which system wide version of PHP you want to use by default. $ sudo update-alternatives –config php Enter the selection number to set it as default version or simply press ENTER to keep the current

Find and replace text within a file using sed command

The procedure to change the text in files under Linux/Unix using sed: Use Stream Editor (sed) as follows: sed -i ‘s/old-text/new-text/g’ input.txt The s is the substitute command of sed to find and replace It tells sed to find all occurrences of ‘old-text’ and replace with ‘new-text’ in a file named input.txt Verify that file has been updated: more input.txt

Linux Commands

Report file system disk space usage in a human-readable format $  df -H sample outputs: Estimate file space usage in a human-readable format $  du -H sample outputs: How to get the total size of a directory $  du -hs /path/to/directory sample outputs:   List directory contents $  ls -a sample outputs: Find the Ubuntu Linux distribution version and related information $ lsb_release -a sample outputs: