Vi_Editor_and_GCC_Compiler_Paraphrased
Vi_Editor_and_GCC_Compiler_Paraphrased
Objectives:
Overview:
The "Visual Editor" (vi) is a highly efficient text editor commonly used in Linux and Unix systems.
Known for its versatility, it is popular among both novice and advanced users working in terminal-based
environments. Unlike standard editors, vi operates in distinct modes tailored for specific tasks, offering
1. Command Mode (default mode): Navigate, delete, and execute commands within the file.
2. Insert Mode: Enter this mode by pressing 'i' to add or modify text. Return to Command Mode by pressing
3. Visual Mode: Select text for actions like copying, cutting, or formatting by pressing 'v' in Command Mode
GCC Compiler:
The GNU Compiler Collection (GCC) is a robust, open-source compiler supporting multiple programming la
such as C, C++, and Fortran. It translates high-level programming code into machine-readable code throug
like preprocessing, compiling, assembling, and linking. GCC provides features like optimization (-O2) and d
(-g), enhancing performance tuning and troubleshooting. Its cross-platform compatibility and open-source n
vi abc.c
- Example:
#include <stdio.h>
int main() {
printf("Hello world");
return 0;
- Use the GCC compiler to compile the file and create an output file:
./abc.out
- chmod 400 abc.c: Only the owner can read the file (r--).
This lab illustrated the use of the vi editor and GCC compiler to write, edit, compile, and execute programs
Linux environment. It also highlighted the significance of file security using the chmod command to manage
permissions effectively.