Useful linux Commands For Server Admins

SSH Com­mands

Trans­fer­ring Files from local to remote machine using SSH

AWK Com­mand:

AWK is not a com­mand it is a text inter­pre­ta­tion lan­guage devel­oped by “Aho, Wein­berg­er, and Kernighan in 1970 and thats why it got this name.

awk works on most­ly lin­ux sys­tems, and it is very help­ful for text pro­cess­ing.

 

Dig Com­mand

Dig stands for domain infor­ma­tion grop­er , it is good for trou­bleshoot­ing DNS relat­ed issue.

Alter­na­tive of dig com­mand is host com­mand , exam­ple is below -

It will give you out­put as below -

 

Search Com­mands

search­ing for a file by  name -

Search­ing For text into a file

Cre­at­ing Sym­bol­ic Links

Assign­ing Out­put of a com­mand to a vari­able:

Here Com­mand-

This com­mand is sim­i­lar to perl‘s here com­mand.

This will shell code is use­ful if you want to write mul­ti­ple lines to a file.

>” is used to over­write the file and “»” is used to append that file.

If Con­di­tions:
check­ing whether string is emp­ty or not-

Email Relat­ed Com­mands -

Delete all emails in the queue-
exim -bp | awk ‘/^ *[0–9]+[mhd]/{print “exim -Mrm ” $3}’ | bash

Print a list of mes­sages in queue
exim -bp

GREP Com­mand:

search for a pat­tern in php files recur­sive­ly -

here “r” mean recur­sive­ly and “n” mean dis­play line num­ber.

Oth­er
User­Friend­ly file per­mis­sion view -

vivek

Web Developer & Server Admin, Skilled in Java , PHP , LAMP, Tomcat, Mongo DB & SQL. Available for freelancing project or Open Source Contribution, Feel free to contact me at contact@viveksoni.net .

You may also like...