Lab 2 SETUP LINUX INTERNET AND USER


 
<- Lab1                                                  Lab3 ->





1. Command Line => route    *used to determine IP address and etc
                        => uptime    *used to display current time, time used, number of users..
                        => ls       *used to list all directory where user currently at
                        => date    *used to display date and time with zone
                        => sync    *used to immediate write cached data to disk


- By using arrow key up 3 time we can get back command line "ls"

More shortcut key :








2. By using command line "history", we can get back all the command lines we typed.
- to get back the command line in history, we can use "!" + number we wanted to retrieve










3. By using Tab key, we can auto complete the command without typing all :

- when pressed Tab, the command auto filled unique.txt
-if there are more than one option when press Tab, output :

-if type more specific like "file1" and press Tab, it will auto fill ".txt" :









4. By using "export PS1", we can change the name of default shell prompt :

-"\u" is output the username.
-"\h" is output the hostname.
-"\w" is output the symbol "~".
-"\$" is output the symbol "$".



-More of the environment variable that we can alter using export :










5. By using ".:$PATH", we can temporary set PATH to looked in current directory first. Then the user can add the rest of the path to it by input "$PATH:/location..."  *use ":" to connect two path 

-The original path is ".../snap/bin" , after added become  ".../snap/bin:/linuxmint/java/bin".










6. By using command line "Alias", we can assign a long command line to a shortcut variable to make user execute easily.

-For example, using assign la to command line "ls -la" :


- we can use "unalias" to unassign the variable :


- An example to change directory faster using alias :
*use alias lbook for path to linuxbook
*then use environment variable LBOOK to set path to linuxbook
*copy the f1.txt file to linuxbook with $LBOOK




- END OF LAB 2 -

Comments

Post a Comment