Command |
Meaning |
ls |
list files and directories |
ls -a |
list all files and directories |
mkdir |
make a directory |
cd directory |
change to named directory |
cd |
change to home-directory |
cd ~ |
change to home-directory |
cd .. |
change to parent directory |
pwd |
display the path of the current directory |
cp file1 file2 |
copy file1 and call it file2 |
scp |
copy files/directories accross servers |
mv file1 file2 |
move or rename file1 to file2 |
rm file |
remove a file |
rmdir directory |
remove a directory |
cat file |
display a file |
less file |
display a file a page at a time |
head file |
display the first few lines of a file |
tail file |
display the last few lines of a file |
grep 'keyword' file |
search a file for keywords |
wc file |
count number of lines/words/characters in file |
command > file |
redirect standard output to a file |
command >> file |
append standard output to a file |
command < file |
redirect standard input from a file |
command1 | command2 |
pipe the output of command1 to the input of command2 |
cat file1 file2 > file0 |
concatenate file1 and file2 to file0 |
sort |
sort data |
who |
list users currently logged in |
* |
match any number of characters |
? |
match one character |
man command |
read the online manual page for a command |
whatis command |
brief description of a command |
apropos keyword |
match commands with keyword in their man pages |
ls -lag |
list access rights for all files |
chmod [options] file |
change access rights for named file |
command & |
run command in background |
^C |
kill the job running in the foreground |
^Z |
suspend the job running in the foreground |
bg |
background the suspended job |
jobs |
list current jobs |
fg %1 |
foreground job number 1 |
kill %1 |
kill job number 1 |
ps |
list current processes |
kill 26152 |
kill process number 26152 |
vi/vim |
text editor in UNIX |
ssh |
access to another server from one server |
history |
list commands which have been executed |
cksum |
check file size |
Monday, July 1, 2024
UNIX Commands
Friday, June 28, 2024
UNIX
What is UNIX?
UNIX is an operating system which has been under constant development. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops. UNIX is widely used in computer network systems that have personal computers, workstations, etc.
UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows which provides an easy to use environment. However, knowledge of UNIX is required for operations which aren't covered by a graphical program, or for when there is no windows interface available.
Types of UNIX
The most distinctive characteristic of UNIX is that, unlike other operating systems, detailed contents of the operating system written in C language have been released to the public. For that reason, a great number of computer manufacturers can easily port it to the hardware of their own products. As a result, users are able to operate UNIX in all computer manufacturer products. There are many different versions of UNIX, although they share common similarities. The most popular varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X.
The UNIX operating system
UNIX is an operating system which can perform distributed processing in computer network environments. Its characteristics are mentioned below:
- Distributed processing is presupposed
- It was developed assuming that it would be used in workstations
- It provides the multi-user function, which enables simultaneous use by multiple users. In operating systems that provide the multi-user function, a procedure called log-in, to receive the service, and a procedure called log-out, to report completion, are required
- Through multi-programming, it can simultaneously process multiple jobs. In UNIX, this is called the multiprocessing function
- As a technology to connect computers of different manufacturers, the communication protocol called TCP/IP has been established
- It has instruction rights called commands that enable the user to use UNIX in an interactive mode. This function is called human interface, and has been implemented by X-Window
- The program development tools are abundant
UNIX is an operating system which can be simultaneously used by multiple users, and in which each user can simultaneously perform multiple job processing. The UNIX operating system is made up of three parts; the kernel, the shell and the programs.
The kernel
UNIX has a control program called Kernel, which has the following functions:
- It is the central part of the operating system, and controls the system resources
- It performs the process management. (Since UNIX is distributed-processing oriented, jobs are called processes)
The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the filestore and communications in response to system calls.
The shell
The shell acts as an interface between the user and the kernel. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. A shell has the following functions:
- It interprets the commands input by the users and calls the kernel function
- It executes a program called a shell script, which combines commands
Likewise, the command uses the devices connected to the system, and call the kernel function to use the command sets.
The commands are themselves programs: when they terminate, the shell gives the user another prompt.
A user logs in -> the login program checks the username and password -> the login program starts the shell
A user types a command -> the shell searches the filestore for the file containing the program (command) -> the shell requests the kernel through system calls to execute the program
The process (command) has finished running -> the shell returns the UNIX prompt
Filename Completion - By typing part of the name of a command, filename or directory and pressing the [Tab] key, the tcsh shell will complete the rest of the name automatically. If the shell finds more than one name beginning with those letters you have typed, it will beep, prompting you to type a few more letters before pressing the tab key again.
History - The shell keeps a list of the commands you have typed in. Use the cursor keys to scroll up and down to repeat a command or type history for a list of previous commands
Files and processes
Everything in UNIX is either a file or a process.
A process is an executing program identified by a unique PID (process identifier).
A file is a collection of data. They are created by users using text editors, running compilers etc.
Examples of files:
- a document
- the text of a program written in some high-level programming language
- instructions comprehensible directly to the machine and incomprehensible to a casual user, for example, a collection of binary digits (an executable or binary file);
- a directory, which may be a subdirectory and ordinary files.
The Directory Structure
All the files are grouped together in the directory structure.
Thursday, June 27, 2024
Pair Testing
Pair testing is a software development technique in which two team members work together at one keyboard to test the software application. One does the testing and the other analyzes or reviews the testing. This can be done between one tester and developer or business analyst or between two testers with both participants taking turns at driving the keyboard.
This will help both the members to learn more about the application. This will narrow down the root cause of the problem while continuous testing. Developer can find out which portion of the source code is affected by the bug. This track can help to make the solid test cases and narrowing the problem for the next time.
Benefits
The developer can learn more about the software application by exploring with the tester. The tester can learn more about the software application by exploring with the developer.
Less participation is required for testing and for important bugs root cause can be analyzed very easily. The tester can very easily test the initial bug fixing status with the developer.
This will make the developer to come up with great testing scenarios by their owns
Drawbacks
This can not be applicable to scripted testing where all the test cases are already written and one has to run the scripts. This will not help in the evolution of any issue and its impact.
Usage
This is more applicable where the requirements and specifications are not very clear, the team is very new, and needs to learn the application behavior quickly.
This follows the same principles of pair programming; the two team members should be in the same level.
Wednesday, June 26, 2024
Load Testing
Load testing is the process of putting demand on a software system and measuring its response. Load testing is performed to determine a system’s behavior under both normal and anticipated peak load conditions. It helps to identify the maximum operating capacity of an application as well as any bottlenecks and determine which element is causing degradation.
Load testing is used in different ways.
*Multi-user systems
Load testing generally refers to the practice of modeling the expected usage of a software program by simulating multiple users accessing the program concurrently. As such, this testing is most relevant for multi-user systems, often one built using a client/server model such as web servers. As an example, a web site with shopping cart capability is required to support 100 concurrent users broken out into following activities:
- 25 virtual users log in, browse through items and then log off
- 25 virtual users log in, add items to their shopping cart, check out and then log off
- 25 virtual users log in, return items previously purchased and then log off
- 25 virtual users just log in without any subsequent activity
A test analyst can use various load testing tools to create these virtual users and their activities. Once the test has started, the application’s performance can then be monitored and captured.
*Other types of software systems
For example, a word processor or graphics editor can be forced to read an extremely large document or a financial package can be forced to generate a report based on several years’ worth of data.
Statistics that will be analyzed include the CPU, memory, disk IO of the physical servers and the response time.
Possible causes for slow system performance include, but not limited to, the following:
- Application servers or software
- Database servers
- Network – latency, congestion, etc.
- Client-side processing
- Load balancing between multiple servers
User experience under load test
In the example above, while the device under test (DUT) is under production load - 100 VUsers, run the target application. The performance of the target application here would be the User Experience Under Load. It describes how fast or slow the DUT responds, and how satisfied or how the user actually perceives performance.
Browser-level vs. protocol-level users
Historically, all load testing was performed with automated API tests that simulated traffic through concurrent interactions at the protocol layer (often called protocol level users or PLUs). With the advance of containers and cloud infrastructure, the option is now present to test with real browsers (often called browser level users or BLUs). Each approach has its merits for different types of applications, but generally browser-level users will be more akin to the real traffic that a website will experience and provide a more realistic load profile and response time measurement. BLUs are certainly a more expensive way of running tests and cannot work with all types of applications, specifically those that are not accessible through a web browser like a desktop client or API-based application.
Load testing tools
Tool name |
Company name |
License |
Pricing |
Notes |
An Apache Jakarta open source project |
Free |
Java desktop application for load testing and performance measurement. |
||
Proprietary |
Trial available |
Primarily used for executing large numbers of tests (or a large number of virtual users) concurrently. Can be used for unit and integration testing as well. |
||
SmartBear Software |
Demo available |
Cross-platform load testing tool, targeted mainly at web services. Integrates with soapUI. |