Basic Linux commands are very useful to get mastering in language learning step, Why Linux? only Linux is Abel to give the flexibility to reach out to a low-level component in the system and it plays an important role in modularity and flexibility of the operating system. Let’s build a foundation to learn C language.
In the market, lots of IDE are available to compile your code. Such as code blocks, Xcode. But these tools are not that useful for core C learners. Then you will think, what tool should I use now? Ans is UNIX.
Yes, you read it right. I strongly suggest you use a Linux based operating system. If you using windows OS then dual boot your system and install Ubuntu as a secondary OS. or use a virtual terminal and install Ubuntu on it. For macOS, no much modification is needed. But to compile C code in the macOS terminal it is mandatory to install Xcode from the App Store.
I am hoping that you are done with all setup. now let’s dig into it.
Some basic Linux commands will very useful for all tasks and later we will go with a much higher version of commands.
cheat-sheet of commands
The “ls” command is a command-line utility for listing the contents of a directory or directories.
cd [Directory name]
“cd” means change directory. generally used to change the current directory.
“pwd” means print working directory. It will print the full system path of the current working directory.
“..” means parent directory
“.” means current directory
This command is used to move to the parent directory of the current directory.
only command “cd” without any keys will take you to the home directory.
It will clear the screen.
mkdir [Directory name]
“mkdir” means make directory. creating a new directory in the current directory.
vim [filename][file extension]
“vim” is a one of the great text editor. You will find all the useful tricks here : vim editor, vim commands everything you should know.
rmdir [Directory name]
rm -r [Directory name]
“rmdir” means to remove the directory. If your directory is not containing any files then it will delete the file.
“rm” is a command, “-r” is a key to forcefully remove the directory, it is useful when your directory is not empty. Moreover, “rm“ can be useful to remove a single file without using the “-r” key.