Show Menu
Cheatography

Linux Terminal for tester Cheat Sheet (DRAFT) by

Basic linux command line cheet sheet for testers

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Reading logs

$ tail
tail [file]
shows the end of file
 
-n 300 [file]
display desired (300) number of rows
 
-f
display real time file updates
example
$ tail -n 300 consol­e.log
display 300 rows from the bottom
 
$ head
 
shows the top of file

Integr­ation test

$ ping <ho­st>
 
service aviala­bility
 
$ telnet <ip> <po­rt>
 
check ports
example
 
telnet checki­p.d­ynd­ns.org 80
 

Global search

$ grep
grep [options] [pattern] [files]
Globally search for a REgular expression and Print matching lines
 
-i [pattern] [file]
regist­erless search
 
-w [pattern] [file]
full word match
 
-c [pattern] [file]
check number of matches
 
-r [pattern] *
search in subdir­ectory
 
-v [pattern] [file]
inversion search
 
-n [pattern] [file]
enumerate lines
 
-l [pattern] [file]
display names
 
`-e [pattern] [file]
several search patterns
example
$ grep -e [pattern1] -e [pattern2] -e [patte­rn3­]...[file]
 

DB access

$ psql
 
connect to the DB (utility)
 
-h
host of DB
 
-U
user for DB login
example
$ psql -h localhost -U <us­er>

Working with URL

$ curl <op­tio­n> <li­nk>
 
utility to work with URL
 
-o <file url>
display page content in the file
 
-O <file url>
display page content in the file, with server file name
 
example
 
 
-d "­<GET parame­ter­s>"<­URL>
perform GET request
 
example
 curl -d "­fie­ld1­=va­l&­fil­eld­2=v­al1­"­htt­p:/­/po­stt­est­ser­ver.co­m/p­ost.php