Skip to main content

Examples Of Basic Commands Used in C / Ubuntu / Putty

Hey All,

Today we will see a very simple example of the usage of those commands which i had mentioned on my old post .If you have not yet checked it out ,visit below link

👇     👇
Detailed Explanation of Basic Commands
👆     👆

Sample Usage :-






[17303102@SampleServer1 ~]$ 

  1. ls                                   //shows the content of the current directory
  2. mkdir lab1                    //make a folder named "lab1"
  3. ls
  4. pwd                              //shows the address of the directory where you are  currently working                                          //on    c
  5. cd lab1                        //Navigates/Goes To the directory "lab1"  created earlier
  6. pwd
  7. ls
  8. vi hello.c                   //creates or opens the file named "hello.c" here 'c' denotes the                                                      //filetype/extension
  9. ls
  10. cc hello.c                  //compiles the file named "hello.c" and saves it to the default file  named                                    //"a.out"
  11. ls
  12. cc hello.c -o hello.out //compiles the file named "hello." and saves it the the custom file named                                     //"hello.out"
  13. ls
  14. ./hello.out                   //runs/executes the file named "hello.out"
  15. vi add.c                       //opens another file named "add.c"
  16. cc add.c
  17. cc add.c -o add.out
  18. ./add.out
  19. pwd
  20. cd ..                     //explained already in the other post mentioned at the starting of this post
  21. ls
  22. mkdir lab2
  23. ls
  24. pwd
  25. ls
  26. cd lab1
  27. pwd
  28. ls
  29. cd ..
  30. pwd
  31. cd lab2
  32. vi 2a.c
  33. cd
  34. pwd



Source :- Reference Books and Ubuntu Support

This guide was last updated on 25/10/17 and is up to date till the above mentioned date.
I will not be responsible for any damage to your system due to any mistake by you in following the guide correctly !
If you face any difficulties or the steps fail ,try contacting  me ! I will try my best to help you !






Have a nice day !
-Febin Koshy Philip
 Febkosq8

Comments