unix_basics

18
UNIX/LINUX BASICS FOR QA Alex Polovinko 2/7/2015

Upload: alexander-polovinko

Post on 08-Aug-2015

27 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Unix_basics

UNIX/LINUX BASICS FOR QA

Alex Polovinko2/7/2015

Page 2: Unix_basics

Overview and objectives

• Familiarizing yourself with Unix/Linux console• Understanding of command structure• Typical QA tasks and troubleshooting skills• Most commonly used commands

Page 3: Unix_basics

Agenda:# What is Unix/Linux (5min)# Login to system (10 min)# Console look and basic system commands (10 min)# Command structure (5 min)# Networking and connectivity (10 min)# Working with files (10 min)# Working with logs and search (10 min)# Shell scripting (5 min)# Services and applications (10 min)# Daemons and cron processes (5 min)# Installation, archiving (10 min)#Q&A (10 min)

+ Demo and hands on exercise ~ 30% time allocation

Page 4: Unix_basics

Why *nix- First OS with natural multiusers support

- Open source/ community support

- Easy for administrating and tuning

- Less resources consumption

- Good server choice

Page 5: Unix_basics

Logging to system:Secure shell (ssh): putty => Win and ssh client (Unix/IOS)http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Authentication: user/password and public/private key

Page 6: Unix_basics

Console and basic commands#directory/folders: concept of root/ubuntu privileged user#pwd#whoami, who, users, w, finger <user>#concept of home folder#console (tab, select, insert, arrows)#history#processes (ps [–ef]), top, uptime, kill, kill -9#date#hostname, uname [–mrs],[-a], free [-m], lscpu, cat /proc/meminfo| /proc/cpuinfo, mount#bash/kash#spacing and disk usage (df –k, su –dk)#reboot and shutdown#system settings (ex: /etc/hosts)

Page 7: Unix_basics

• Arguments1

• Pipes2

• Output and input3

• Man and help4

Command format

Page 8: Unix_basics

Networking and connectivity

• Ping/tracert • Telnet [port], localhost, telnet 0• Ssh and ssh tunnel• Curl [-k] [-x] • Netstat• Wget• Ipconfig

Page 9: Unix_basics

FILES AND FOLDERS- CD- MKDIR/RMDIR- LS [-LRT]- CP/SCP/WINSCP- MV/RM [-RF]- WILD CARD (*)- TOUCH- DIFF- CAT- FILE PERMISSIONS AND USER GROUPS: SUDO AND ROOT USER- CHOWN AND CHMOD- DOT (./) AS CURRENT FOLDER- SYMBOLIC (SOFT) LINK: LN -S

Page 10: Unix_basics

EMBEDDED VI EDITOR

- VI/VIM/NANO- READ/INSERT MODES- SEARCH- LINE #- EDIT AND SAVE- EXIT

Page 11: Unix_basics

Working with server logs and search- tomcat/apache log level- rsyslog/syslog- tail [-f]- more/less/head- find/locate- grep/egrep (regex), zgrep- grep [-i] [-v]- concept of Recursion- nullify log: cat /dev/null >

log.txt

Page 12: Unix_basics

Exercise1. Find any uniq value in all files in current folder

2. The same on the whole server

Page 13: Unix_basics

Shell scripts

How to runExecution permissions

What is inside

Example

Page 14: Unix_basics

Unix services and applications

sendmailrsyslogiptables (firewall)mysqlwebservers start/stop

Page 15: Unix_basics

Daemons and cron processes

• What is daemon• Cron functionality• Cron format:10 8 1 * *

Page 16: Unix_basics

Misc

• Archive– untar: tar -zxvf myfile.tar.gz– tar -czf workspace.tar.gz *

Install: yum/apt-getrpm packets

Page 17: Unix_basics

Resources

• Unix commands<http://www.cheat-sheets.org/saved-copy/fwunixref.pdf>

• Additional reading material text here< http://www.cyberciti.biz/tips/linux-unix-commands-cheat-sheets.html >

• This slide deck and related resources:<Facebook group>

Page 18: Unix_basics

QUESTIONS?