1

echo $USER |ENTER|

root

2.

echo $HOME |ENTER|

/root

3.

echo $SHELL |ENTER|

/bin/bash

4.

ls -la $PWD |ENTER|

total 40
dr-xr-x--- 3 root root 241 Sep 15 2018 .
drwxrwxrwx 21 root root 575 Sep 18 10:16 ..
-rw-r--r-- 1 root root 18 Jul 15 2018 .bash_logout
-rw-r--r-- 1 root root 176 Jul 15 2018 .bash_profile
-rw-r--r-- 1 root root 176 Jul 15 2018 .bashrc
-rw-r--r-- 1 root root 113 Sep 9 2018 bench.py
-rw-r--r-- 1 root root 100 Jul 15 2018 .cshrc
drwx------ 3 root root 68 Dec 31 1969 .emacs.d
-rw-r--r-- 1 root root 185 Sep 9 2018 hello.c
-rw-r--r-- 1 root root 129 Jul 15 2018 .tcshrc

5.

ls -sh |ENTER|

total 8.0K
4.0K bench.py 4.0K hello.c

6.

cat hello.c |ENTER|

/* This C source can be compiled with:
gcc -o hello hello.c
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello World\n");
return 0;
}

7.

gcc -o hello hello.c |ENTER|


8.

ls -l |ENTER|

total 20
-rw-r--r-- 1 root root 113 Sep 9 2018 bench.py
-rwxr-xr-x 1 root root 9448 Sep 18 12:13 hello
-rw-r--r-- 1 root root 185 Sep 9 2018 hello.c

9.

./hello |ENTER|

Hello World

10.

cp hello.c hello-banksy.c |ENTER|

vi hello-banksy.c |ENTER|

/* This C source can be compiled with:/* This C source can be compiled with:
gcc -o hello hello.c
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello World\n");
return 0;
}
~ ~ ~ ~ ~ "hello.c" 11L, 185C

11.

Inside vi editor

1G08j12l

printf("Hello World\n");

12.

2dw

printf("\n");

13

iHello Banksy, paint my city! |ESC|

printf("Hello Banksy, paint my city!\n");

14.

:w |ENTER|


15.

:q |ENTER|


16.

returning back to BASH

ls |ENTER|

bench.py hello hello-banksy.c hello.c

17.

ls / |ENTER|

mkdir /home/bin |ENTER|

gcc -o /home/bin/hello hello-banksy.c |ENTER|

ls /home/bin |ENTER|

echo $PATH |ENTER|

export PATH=$PATH:/home/bin |ENTER|

hello |ENTER|


bin dev home lib64 media opt root sbin sys usr
boot etc lib lost+found mnt proc run srv tmp var

hello

/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

Hello Banksy, paint my city!


END OF THIS EXERCISE