Inspect TXT records of a domain

 host -t txt google.com 

Create a database

When all the servers installed above, it’s now time to begin setting up WordPress environment. First, run the steps below to create a blank database for WordPress to use.

Logon to MariaDB database console using the commands below:

sudo mysql -u root -p

Then create a database called wpdb

CREATE DATABASE wpdb;

Next, create a database user called wpdbuser and set password

CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database.

GRANT ALL ON wpdb.* TO 'wpdbuser'@'localhost' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;

List all mysql users

login into mysql:

sudo mysql -u root -p


list all users:

SELECT User,Host FROM mysql.user;

Importing the database

From the normal command line, you can import the dump file with the following command:

mysql -u username -p new_database < data-dump.sql

Export all database to one file

mysqldump -u root -p --all-databases > alldb.sql

Import all databases

mysql -u root -p < alldb.sql

cp command syntax

Use the following syntax:
cp -a {/path/to/source} {/path/to/destination}

For example copy all files including subdirectories from /mnt/dvd/data to /home/tom/data, enter:

 cp -a /mnt/dvd/data/* /home/tom/data

OR
 cp -av /mnt/dvd/data/* /home/tom/data

Remove a PPA from the source list in terminal

Alternatively, you can remove the PPA from sources list where these PPAs are stored. PPAs are store in the form of PPA_Name.list. Use the following command to see all the PPAs added in your system:

sudo ls /etc/apt/sources.list.d

Look for your desire PPA here and then remove the PPA using the following command:

sudo rm -i /etc/apt/sources.list.d/PPA_Name.list

Copy all files by extension to single directory

Execute the next: 

cp -R *.tif /yourfolder

Inspect txt records of a domain

host -t txt google.com

Installing screen package

Keep it running in backend

first, install screen: 
sudo apt-get install sudo screen

run a new session with any name. e.g. mycustomsession

screen -S mycustomsession


then start any comment. e.g. code-server

code-server

Press Ctrl+a and immediately z to disconnect from the session and leave it running as a background process.
In the future, to return, let’s see the list of running sessions and connect to the desired one:

screen -ls
screen -r mycustomsession

 

Extract .tar.gz/.tgz archive to specific folder

To extract a foo.tar.gz (.tgz extension file) tarball to /tmp/bar, enter:

mkdir /tmp/foo
tar -zxvf foo.tar.gz -C /tmp/foo