Your first linux programs
-
Upload
ahmed-al-zaidy-mis -
Category
Education
-
view
93 -
download
0
Transcript of Your first linux programs
![Page 1: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/1.jpg)
Your First Linux
ProgramBY AHMED AL ZAIDY
![Page 2: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/2.jpg)
Made Specially for Jones College
Students
INTRODUCTION TO UNIX
2015
![Page 3: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/3.jpg)
PuTTY
You need to Download the PuTTYShell Program.
After Starting PuTTY Enter the Linux Server Information
Server Address: DLLinux.jones.edu
After That click on Open.
Enter your Username and Password
* Note you will NOT see the password typed into the Shell but complete the password and press Return (Enter).
![Page 4: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/4.jpg)
Hello Word Program Source Code
First C Programming
Vi Editor
Type into the shell
vi hello.c
Copy the source code below.
#include<stdio.h>
void main()
{
printf("Hello! This is my first C
program with Ubuntu
11.10\n");
/* Do something more if you
want */
}
![Page 5: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/5.jpg)
Hello Word Program Source Code
First C Programming
Vi Editor
Press ESC Button
Type into vi
:wq
To write the file and quite
type into the shell the code
gcc hello.c -o hello1
Then type
./hello1
![Page 6: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/6.jpg)
Hello Word 2 Program Source Code
Second C Programming
VI Editor
Type into Shell
vi chapter1_2.c
Copy the text into the vi
Then press ESC
Type :wq
Then type into the shell
gcc -o hello2 chapter1_2.c
./hello2
./hello2 my name is ahmed
#include<stdio.h>
int main(int argc, char*argv[])
{
int i=0;
printf("hello, you are learning
C!!\n");
printf("Number of arguments
to the main function:%d\n, argc");
for(i=0; i<argc; i++)
{
printf("argument number %d
is %s\n",i, argv[i]);
}
return 0;
}
![Page 7: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/7.jpg)
A to Z Program Source Code
Third C Programming
VI Editor
Type into Shell
vi atoz.c
Copy the text into the vi
Then press ESC
Type :wq
Then type into the shell
gcc -o atoz1 atoz.c
./atoz1
#include <stdio.h>
int main()
{
char c;
for(c='A'; c<='Z'; ++c)
printf("%c ",c);
return 0;
}
![Page 8: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/8.jpg)
Screen Shot First C Program
![Page 9: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/9.jpg)
Screen Shot Second C Program
![Page 10: Your first linux programs](https://reader035.fdocuments.in/reader035/viewer/2022080907/55a797851a28ab751f8b48f0/html5/thumbnails/10.jpg)
Screen Shot Third C Program