unix-lab1
unix-lab1
Introduction to Unix
Hence, it's recommended by professionals who operate with servers; it's also
recommended to learn how the command-line-based operating system works.
Many large and complex applications that utilize Unix to execute because of its
aspect to handle the processes easily. It's a bit faster and provides a nice user
experience when compared with the Windows operating system.
Several testing activities, such as performance and installation testing,
depending on OS knowledge. Almost every web server is Unix based
nowadays. So, knowledge of Unix is essential for testers. If we are unfamiliar
with Unix, then learning Unix commands can be a great start. One of the best
ways to understand these commands is to practice and read them simultaneously
on Unix OS.
Study of Unix basic command list: man, who, cat, cd, cp, ps, ls, mv, rm, mkdir,
rmdir, echo, more, date, time, kill, history, chmod, chown, finger, pwd, cal,
logout, shutdown.
bash
$man ls
$who
Output:
4. cd - Change directory
$cd /home/user
Other uses:
o To go back to the previous directory: cd -
o To go to the home directory: cd ~
cp file1.txt /home/user/backup/
To copy directories:
cp -r directory_name /home/user/backup/
6. ps - Report process status
ps aux
ls -l
This lists files with detailed information like permissions, size, and
modification time.
8. mv - Move or rename files or directories
bash
Copy code
mv file1.txt file2.txt
To move a file:
mv file1.txt /home/user/backup/
9. rm - Remove files or directories
$rm file1.txt
$rm -r directory_name
10. mkdir - Make directories
$ mkdir new_directory
11. rmdir - Remove empty directories
$rmdir new_directory
12. echo - Display a line of text or variables
$more largefile.txt
$date
Output:
time ls
$kill 1234
$history
18. chmod - Change file permissions
Explanation:
o 7 = read, write, and execute for the owner.
o 5 = read and execute for the group.
o 5 = read and execute for others.
$finger user1
21. pwd - Print working directory
$pwd
Output:
arduino
Copy code
/home/user/Documents
22. cal - Display a calendar
$cal
Output:
css
Copy code
December 2024
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
23. logout - Logout from the current session
$logout
24. shutdown - Shut down or restart the system
$shutdown -h now
To restart:
$shutdown -r now