Lab - 7-OS
Lab - 7-OS
Utility Programs
T / Ebtisam ALselwi 1
Function
Command
T / Ebtisam ALselwi 2
grep Command
T / Ebtisam ALselwi 3
grep Command
T / Ebtisam ALselwi 4
grep Command
T / Ebtisam ALselwi 5
grep Command
T / Ebtisam ALselwi 6
sort command Display content of file
ebtisam
amal
sahar
kawkab
manal
hayam
zinab
T / Ebtisam ALselwi 7
Sort a file
amal
ebtisam
hayam
kawkab
manal
sahar
zinab
T / Ebtisam ALselwi 8
Sort a file inverse
zinab
sahar
manal
kawkab
hayam
ebtisam
amal
T / Ebtisam ALselwi 9
Move content of sample 1 To sample in order with delete content of
sample
std@ubuntu:~$ sort sample1.txt>sample.txt
Befor After
T / Ebtisam ALselwi 10
Marge content of sample and sample1 To sample2 in order
T / Ebtisam ALselwi 12
unZip sample 1 and sample
T / Ebtisam ALselwi 13
Piping and Redirection
T / Ebtisam ALselwi 14
Page by page : press space key
Function
Command
T / Ebtisam ALselwi 15
To more : press space key
std@ubuntu:~$ more /etc/*.conf To exit :press q key
Display content in same page Can not use pgup,pgdn
T / Ebtisam ALselwi 16
To more : press space key
std@ubuntu:~$ more /etc/*.conf To exit :press q key
Display content in same page Can not use pgup,pgdn
T / Ebtisam ALselwi 17
To more : press space key
std@ubuntu:~$ less /etc/*.conf To exit :press q key
Display content in another page Can use pgup,pgdn
T / Ebtisam ALselwi 18
To more : press space key
std@ubuntu:~$ less /etc/*.conf To exit :press q key
Display content in another page Can use pgup,pgdn
T / Ebtisam ALselwi 19
Pipe command
std@ubuntu:~$ ls /etc/ | less
T / Ebtisam ALselwi 20
Pipe command(con…)
ebtisam3:x:1003:1006::/home/ebtisam3:
T / Ebtisam ALselwi 21
Pipe command(con…)
syslog:x:100:103::/home/syslog:/bin/false
saned:x:108:116::/home/saned:/bin/false
std:x:1000:1000:ebtisam,,,:/home/std:/bin/bash
ebtisam:x:1001:1001:,,q,exit:/home/ebtisam:/bin/bash
ebtisam3:x:1003:1006::/home/ebtisam3:
newuser2:x:1050:1050:newuser2,123,1452,4521,4521:/home/lab:/bin/bash
user:x:1005:1011:user,4521,1254,125,4152:/home/user:/bin/bash
user11:x:1082:1005::/home/uh2:
T / Ebtisam ALselwi 22
Redirection
188
T / Ebtisam ALselwi 23
Redirection(con…) put content of passwd file into
output.txt file
std@ubuntu:~$ cat /etc/passwd > output.txt
std@ubuntu:~$ cat output.txt
T / Ebtisam ALselwi 24
Redirection(con…) put content of passwd file into
output.txt file
std@ubuntu:~$ cat /etc/passwd > output.txt
std@ubuntu:~$ cat output.txt
T / Ebtisam ALselwi 25
T / Ebtisam ALselwi 26
Redirection(con…) Add content of hosts file into
output.txt file
std@ubuntu:~$ cat /etc/hosts >> output.txt
std@ubuntu:~$ cat output.txt
T / Ebtisam ALselwi 27
C compiler
Function
Command
T / Ebtisam ALselwi 28
Verify compiler is exist
C compiler(con…)
Display the path of compiler on
Linux
std@ubuntu:~$ whereis gcc
/usr/bin/gcc
T / Ebtisam ALselwi 29
Display the version number of
C compiler(con…) compiler on Linux
T / Ebtisam ALselwi 30
C compiler (con…) The Steps
T / Ebtisam ALselwi 31
Nano editor :
open file in nano editor
std@ubuntu:~$ nano f.c
T / Ebtisam ALselwi 32
Write program in C language
#include<stdio.h>
int main()
{
printf("Hello Word\n");
return 0;
}
1- Ctrl + O Save
2- Press Enter Key
3- Ctrl + X Exit from Nano editor
T / Ebtisam ALselwi 33
T / Ebtisam ALselwi 34
Compile f.c with g++ or gcc
T / Ebtisam ALselwi 35
Execute f.out
Hello Word
T / Ebtisam ALselwi 36
End…
T / Ebtisam ALselwi 37