Download - Unix_basics
UNIX/LINUX BASICS FOR QA
Alex Polovinko2/7/2015
Overview and objectives
• Familiarizing yourself with Unix/Linux console• Understanding of command structure• Typical QA tasks and troubleshooting skills• Most commonly used commands
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
Why *nix- First OS with natural multiusers support
- Open source/ community support
- Easy for administrating and tuning
- Less resources consumption
- Good server choice
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
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)
• Arguments1
• Pipes2
• Output and input3
• Man and help4
Command format
Networking and connectivity
• Ping/tracert • Telnet [port], localhost, telnet 0• Ssh and ssh tunnel• Curl [-k] [-x] • Netstat• Wget• Ipconfig
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
EMBEDDED VI EDITOR
- VI/VIM/NANO- READ/INSERT MODES- SEARCH- LINE #- EDIT AND SAVE- EXIT
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
Exercise1. Find any uniq value in all files in current folder
2. The same on the whole server
Shell scripts
How to runExecution permissions
What is inside
Example
Unix services and applications
sendmailrsyslogiptables (firewall)mysqlwebservers start/stop
Daemons and cron processes
• What is daemon• Cron functionality• Cron format:10 8 1 * *
Misc
• Archive– untar: tar -zxvf myfile.tar.gz– tar -czf workspace.tar.gz *
Install: yum/apt-getrpm packets
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>
QUESTIONS?