Linux

A short introduction to a few essential Linux/Server commands you need to must know !

Kartic1 min read

A short introduction to a few essential Linux/Server commands you need to must know !

Search keywords to directory and files

cd ~/your directory
$ grep -rwI KeywordCaseSensitive 

Explanation:

-r search recursively
w search for a word only (i.e. surrounded by white space and/or punctuation)
I ignore binary files

You may consider option -i (ignore case).

Tar zip directory and files

tar -cvzf directory.tar.gz directory

Tar unzip directory and files

tar -xvzf directory.tar.gz directory

SSH connection by CLI

ssh username@hostname

Connection with mysql by CLI

mysql -h hostname -u username -p password

Import database to mysql by CLI

mysql -h hostname -u username -p password databasename < database name.sql

Export database from mysql by CLI

mysqldump -h hostname -u username -p password databasename >  database name.sql

 

Share this articleLinkedIn X

Discussion (0)

Sign in to join the discussion.

Delete this comment?

This will also remove its replies.

Keep exploring

Follow the engineering notes.

Subscribe for technical articles from iTechOrbit.