Introduction: Beginners Guide to Accessing C Files in the SSH Putty

Putty is an external resource for editing and using the programming language C. Many windows users often revert to Putty because of its security and easy ability to access the different built in tools. Yet, For many beginners the system is unlike others, therefore posing a challenge when trying to access the different features and files. In order to create and work on projects one must master the ability to open C, manipulate files, enter them, and make edits using emacs Putty’s editing system. This instruction set will teach you the basics of navigating the directory and opening files. There are multiple ways to do this. Each of these methods have different levels of access and will be described. The different methods can be confusing but this instruction set will highlight the different reasons one may want to use a specific method. The process of opening and accessing files can be consuming but you should learn the different ways to access files. Let's get started!

Supplies

What do you need:

  1. Putty.
  2. Domain and log in. 

Approximate time: This should take no longer than 5 minus, the steps are quick and easy. With enough practice this will take less than 2 minutes. 

Step 1: Enter Domain

By clicking on the putty application, the domain option will be automatically opened. Navigate the Host Name where you will need to enter the domain name. If you're unsure of what domain to access either, create your own using another instruction sheet as guidance. If you're meant to join a specific domain be sure you have the correct domain name and be cognizant of punctuation and capitalization. 

Step 2: Log In

Log in may be specifically outlined in order to access the domain. Without this login you will not be able to access the shell. Be precise when typing in your credentials. If you're unsure of your domain log in talk to your domain provider. 

Once you're successfully logged in you'll be taken to the command prompt where you will be entering commands to access the file. 



Step 3: Access/Create Directory

The directory is where all of the files are placed. This is an effective way to group all project files under one area. 

Use mkdir to create a directory and write the desired name. This is helpful if you're creating a new project and need to hold all of the files. To create the file simply enter mkdir fileName, enter once satisfied. Be sure to replace fileName with your desired file name.

If the file you wish to access is already created. Type ls, enter into the common prompt and click enter. This will display the names of the different directories, all of which are capable of holding files.

Ls Example 


Step 4: Enter the Directory

Use cd to enter the directory giving you access to the different files. Type cd fileName, and click enter once you have typed in the directory you wish to access. This will automatically take you inside the directory. Once inside the directory the command prompt should say the directory name.

Step 5: Navigate to the File

Use ls to see what files are in the specific directory. Keep in mind, using ls inside of a directory only shows the files within the directory. If the specific file you want is not listed when using ls, use cd to return back and exit the directory. This will allow you to enter a new directory. 

Step 6: Create a New File

To make a new file use the command touch with the file name formatted as touch fileName. Be sure to replace fileName with the desired name. To check that the file has been created use ls. Be sure you are inside the directory when checking.


Step 7: Editing a File

To open any file use emacs fileName.c; replace fileName with the actual file name. This command prompt will take you to the emacs window. Emacs can be hard to navigate which is why it is best to have another instructions menu to navigate the editing software. Emacs will allow you to edit the new file created using touch and any other preexisting file.

Inside emacs



Step 8: Exiting Emacs

If you want to exit emacs simply use ctrl-z. Be sure to save the file before leaving. The easiest way is to use ctrl-x-s. There are many ways to use emacs, and many sources to strengthen your skills. 


Step 9: Using Cat to See a File:

If you do not want to edit the file, but want to see inside of it use cat fileName. This can be helpful when still unsure of emacs, but also when you need to quickly see what is in the file. This command will print everything in the file. 

Cat


Step 10: Celebrate

Congratulations you have now successfully accessed your file and began the steps of manipulation. You have navigated through the directory or made a new one, as a result of entering the directory you either created a new file or accessed an old one. From here you had a choice to either edit the file or print the file within the shell to access the file without editing it. In order to advance your file skills using the shell, Putty accesses another instruction manual. As of now you're able to do the basics and can get started with writing C.