LAB 2

 


 

DKT 221/3

OPERATING SYSTEM PRINCIPLE

 

 

LAB MODULE 2













PART 1

1.     Type in the command and press the ENTER
- route


2.     Do the same , pressing ENTER after each command
- uptime
- ls
- date
- sync


3.     Now , press the up arrow key one time . You should see the following command
- sync


4.     Now press the up arrow two more times . You should see
        First time :
- date


Second time :
- ls


 5.     Press ENTER , the last command will run again . Pressing ENTER will always run the command shown







PART 2

1.     Run a few commands such as
- route
- uptime
- date
- sync


2.     Next , run this command

- history


3.     Look for a command you would like to run again , but instead of trying the command , type an exclamation point (!) and then the number next to the command as shown in the history listing and press ENTER

- !10

4.     That command will run again






PART 3

1.     Change to your home directory , in my case it's

- cd /home/rienlinux


2.     Create a directory using the following command

- mkdir Linuxbook


3.     Change to it Linuxbook using the following command

- cd Linuxbook/


4.     In Linuxbook , create 4 files which is File2.txt , File3.txt , File3.txt , File.txt and Unique1.txt

- ls>File2.txt

- ls>File3.txt

- ls>File4.txt

- ls>Unique1.txt


5.     Now let's create some dummy files , run using the following command

- ls>File1.txt 


6.     Type this command and press TAB , the result will in the rest of the filename "Unique1.txt" to appear and press ENTER

- ls -la u


7.     Now type this command and press TAB . Nothing will happen and your console may beep . Press Tab again . Now all 4 filenames will appear 

- ls -la File

First time :


Second time :


8.     Add this command , press TAB again and then ENTER . The command ls -la file4 will run

- 4.txt






PART 4

What is PS1 ?


When we open a fresh terminal the first thing that we can see is (rienlinux@kali)-[~] $ . This is the PS1
We can use the export PS1 command to modify how the PS1 would look like in the terminal
Input this command :

- export PS1= "\u \h \w \$"


1.     Type the PATH command

- echo $PATH

- export PATH= ".:$PATH"

- echo $PATH


2.     Type the EDITOR command

- echo $EDITOR

- export EDITOR=/lewis/bin64/kw

- echo $EDITOR






PART 5

1.     Creating simple command , then ENTER

- tput

- alias cls= "tput clear"


2.     To show long directory listings , we use this command . Then write la and press ENTER

- alias la= "ls -la"

- la


3.     To show the current files last we use the command . Then write la and press ENTER

- alias lt= "ls -latr"

- la






PART 6

1.     Using Ibook in order to open Linuxbook

- alias Ibook= "cd /home/rienlinux/Linuxbook"

- Ibook






PART 7

1. Type this command

- export Ibook= "/home/rienlinux/Linuxbook"

- alias Ibook= "cd $Ibook"

- Ibook

 






PART 8

1.     Type this command

- cd /tmp

- touch F1.txt

- cp F1.txt $Ibook

- Ibook

-ls








Comments

Popular posts from this blog

LAB 2 : Exploring the ESP32 GPIOs

LAB 3

LAB 1