├── 25.Unix Lab Exercises and Solutions.pdf ├── Important Linux Commands.pdf ├── lab0.md ├── lab1.md ├── lab2.md ├── lab3.md └── lab4.md /25.Unix Lab Exercises and Solutions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sonal0409/Linux-Fundamentals/d42aa93f1d157528f8a44410fc52e8792939fce2/25.Unix Lab Exercises and Solutions.pdf -------------------------------------------------------------------------------- /Important Linux Commands.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sonal0409/Linux-Fundamentals/d42aa93f1d157528f8a44410fc52e8792939fce2/Important Linux Commands.pdf -------------------------------------------------------------------------------- /lab0.md: -------------------------------------------------------------------------------- 1 | 1. Execute command to check which user you are logged in 2 | 2. Switch user to superuser root 3 | 3. Clear the screen 4 | 4. List all the commands that have been executed 5 | 6 | Solution: 7 | ============================== 8 | 9 | 1. whoami 10 | 2. sudo su - 11 | 3. clear 12 | 4. history 13 | -------------------------------------------------------------------------------- /lab1.md: -------------------------------------------------------------------------------- 1 | 1. Create a directory SAMPLE under your home directory. 2 | 2. Create a sub-directory by name TRIAL under SAMPLE. 3 | 3. Switch to directory SAMPLE 4 | 4. Change to your home directory. 5 | 5. Print the present working directory. 6 | 7 | ======================================================= 8 | Solution 9 | ======================================================= 10 | mkdir sample 11 | cd sample 12 | mkdir Trial 13 | cd sample 14 | cd 15 | pwd 16 | 17 | -------------------------------------------------------------------------------- /lab2.md: -------------------------------------------------------------------------------- 1 | 1. Create a directory TEST 2 | 2. Change to directory TEST 3 | 3. Create empty files file1 and file2 under Present Working Directory 4 | 4. Display the files file1 and file2. 5 | 5. Append more lines in the file1 6 | 6. Append more lines in the file2 7 | 7. List contents of file1 and file3 together 8 | 8. copy and append content of file1 file2 to file3 9 | 10 | ========================================= 11 | SOLUTION: 12 | ========================================= 13 | 14 | 1. mkdir TEST 15 | 2. cd TEST 16 | 3. touch file1 file2 17 | 4. ls -al 18 | 5. echo "This is file1" >> file1 19 | 6. echo "This is file2" >> file2 20 | 7. cat file1 file2 21 | 8. cat file1 file2 >> file3 22 | -------------------------------------------------------------------------------- /lab3.md: -------------------------------------------------------------------------------- 1 | 1. Change to home directory 2 | 2. Create a file with name 'testfile' using vim editor 3 | 3. Insert some 10 lines of data in the file and Save the contents of the file and exit the file 4 | 4. Now list the first 5 lines of the file 'testfile' 5 | 5. List the last 5 lines of the file 'testfile' 6 | 7 | ============================================== 8 | SOLUTION 9 | =============================================== 10 | 11 | 1. cd 12 | 2. vim testfile 13 | 3. press i 14 | 15 | Linux is a ‘Linux Kernel’ based operating system behaving similarly to the UNIX system. 16 | 17 | It was developed by Linus Torvalds and released on 17th September 1991. 18 | 19 | Linux is a family of operating systems for many different devices. 20 | 21 | Some Linux Operating systems are Ubuntu, Debian, Wayland, GNOME, and Android, etc. 22 | 23 | The logo of the Linux consists of a penguin ‘Tux’, the goodwill of the brand. 24 | 25 | Linux OS comprises Boot loader, Kernel, Graphics Server, Desktop Environment, Applications, etc. 26 | 27 | Unlike other OS, Linux is completely free and comes with Open Source Licence. 28 | 29 | The languages used in writing the Linux OS are Assembler and C. 30 | 31 | Linux has gained popularity in Mainframe Computers and proved to be dominant in Super Computer’s market around the world. 32 | 33 | Linux is the most preferred platform because of its high level of security. 34 | 35 | 5. press ESC key and type :wq! 36 | 37 | 6. head -n 5 testfile 38 | 7. tail -n 5 testfile 39 | -------------------------------------------------------------------------------- /lab4.md: -------------------------------------------------------------------------------- 1 | 1. Change to home directory 2 | 2. Create a 2 new directory mydemo1 mydemo2 3 | 3. Change to directory mydemo1 4 | 4. Create a file fil1 using touch command in directory mydemo 5 | 5. add contents to the file file1 6 | 6. move the file file1 into directory mydemo2 7 | 7. Change to directory mydemo2 8 | 8. Check if file is present in directory mydemo2 9 | 9. copy the contents of the file 'file1' to a new file 'file2' 10 | 10. list the contents of directory mydemo2 11 | 11. Delete the file file1 in directory mydemo2 12 | 12. Go to directory mydemo1 13 | 13. Delete the directory mydemo2 14 | 15 | ============================================ 16 | SOLUTION 17 | ============================================ 18 | 19 | 1. cd 20 | 2. mkdir mydemo1 mydemo2 21 | 3. cd mydemo1 22 | 4. touch file1 23 | 5. cat "this is file in directory mydemo1" > file1 24 | 6. mv file1 mydemo2 25 | 7. cd mydemo2 26 | 8. ls 27 | 9. cp file1 file2 28 | 10. ls 29 | 11. rm file1 30 | 12. cd mydemo1 31 | 13. rm -r mydemo2 32 | --------------------------------------------------------------------------------