Operating System Command-line Interface

 Introduction to LINUX and DOS Operating Environment and Command-line Interface

LAB TASK 

1.    1. Create a directory “Lab02” to hold the material for this lab with a command. Then position your session in the directory. Then create two more sub-directories called lab02a and lab02b.

     Command:

        $ mkdir “lab02”

        $ cd  lab02

        $ mkdir lab02a

        $ mkdir lab02b

      Output:


2.     Create a file “foo” then type the text “Greetings Earthling”  

        Command:

              $ nano foo

              $ cat foo

           

    Output: 


        3.     Repeat the above to create a file called “bar” containing “Take me to your leader”. Combine the two files into one called foobar.

      Comment:

          $ cat > bar

          $ cat foo bar > foobar

          $ cat foobar

      Output:

            



1.     4. Do a directory listing to see the contents of your folder.

            Comment:

                    $ ls

            Output:



 

2.     5. Now take a copy of foobar into each of the lab02a and lab02b sub-directories.

     Comment:

          $ cp foobar lab02a

          $ cp foobar lab02b

          $ ls -l

       Output:



3.    6. Move to subdirectory lab02a. Create a copy of foobar named fobar2 then remove the original foobar file.

          Comment:

$  cd lab02b

$ cp foobar foobar2

$ rm foobar

         Output:



 

4.     7. Move your context to the lab02b subdirectory. Rename the foobar file to be your name.

            Comment:

$ mv foobar2 ..

$ cd ..

$ mv lab2b Sifat

            Output:        


                                                                  

5.     8. Move to your home directory and clear the screen. Take a screen shot of a final full directory after listing.

        Comment:

       $ clear

       $ pwb


        Output:



6.     9.Create two files using march.txt and 2021.txt inside Lab02 folder. Where march.txt contains date information and 2021.txt contains calendar of 2021.

          Comment:

$              touch “march.txt” “2021.txt”

                $ data >> march.txt

                $ cal >> 2021.txt

         Output:




7.     10. Show the history of command that you have used till now.

            Comment:

$ history

            Output:









Previous Post Next Post