This article contains important Linux commands to help performance testers and engineers working on Linux systems.
| Linux Command | Description | Important Options |
|---|---|---|
| sudo | Super User DO: To perform tasks that require administrative or root permissions. Example: $ sudo | -g -h -k |
| su | Switch User: To run a command with another user Example: $ su admin2 | -p -s -l |
| pwd | Print Working Directory: To get the path of the current working directory Example: $ pwd | -L -P |
| cd | Change Directory: To navigate through the file and directory by providing the path Example: $ cd /home/user/project/document | .. |
| ls | LiSt: To get the list of files and directories available in the current directory Example: $ ls | -l -t -r -R -a -lh |
| cp | CoPy: To copy the file or directory. Example: $ cp File.log /home/user/project/document | -R |
| mv | MoVe: To move or rename the file or directory. Example: $ mv File.log /home/user/project/document // To move Example: $ mv OldFile.log NewFile.log // To rename | |
| mkdir | MaKe DIRectory: To create new directory. Example: $ mkdir NewDir | -p -m -v |
| rmdir | ReMove DIRectory: To delete an empty directory permanently. Example: $ rmdir ExistingDir | -p |
| rm | ReMove: To delete a file permanently. Example: $ rm ExistingFile | -i -f -r |
| touch | To create an empty file Example: $ touch /home/user/project/document/hdlc.doc | |
| find | FIND: To search for files within a specific directory Example: $ find -name ExistingFile.txt //Search in the current folder Example: $ find /home/user -name ExistingFile.txt //Search in the specific folder | |
| grep | Global Regular Expression Print: To find a word by searching through all the texts in a specific file. Example: $ grep ERROR /home/logs.txt //Search ERROR in logs.txt file | |
| df | Disk Filesystem: To check the disk space usage Example: $ df -h | -h -m -k -T |
| du | Disk Usage: To check the disk usage of specific file or directory Example: $ du -h logs.txt | -h -m -k -s |
| head | HEADline: To display the first 10 lines of a file. Example: $ head /home/system/logs.txt | -n -c -q |
| tail | TAILline: To display the last 10 lines of a file Example: $ tail /home/system/logs.txt | -n |
| diff | Difference: To compare the content of two files Example: $ diff logs1.txt logs2.txt | -c -u -i |
| tar | Tape ARchieve: To compress zip the file or directory Example: $ tar -cvf logs.tar /home/system/logs | -x -t -u |
| chmod | CHange MODe: To change the read, write and execute permission of a file or directory Example: $ chmod 777 dummy.exe | -c -f -v |
| kill | KILL: To terminate a process using process ID. Example: $ kill 12345 | SIGTERM SIGKILL |
| wget | Www Get: To download a file from the internet Example: $ wget https://www.dummydownload.com/dummySoft.txt | |
| top | TOP: To display the list of active processes along with CPU and memory utilization Example: $ top | |
| history | HISTORY: To display the last 500 commands that are executed. Example: $ history | -c -d -a |
| man | MANual: To display the user manual or description of any linux command Example: $ man pwd | |
| echo | ECHO: To display the text passed in the argument Example: $ echo “PerfMatrix” | -h -e |
| zip | ZIP: To compress the file or directory Example: $ zip logs.zip /home/system/logs | -r |
| unzip | UNZIP: To extract the file or directory from the zip Example: $ unzip logs.zip |
These are some important and basic Linux commands for Performance Testers, Engineers and QA Testers.
You may be interested:
