VOOZH about

URL: https://thenewstack.io/an-introduction-to-developing-from-the-command-line-in-linux/

⇱ An Introduction To Developing From the Command Line in Linux - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-11-27 11:00:39
An Introduction To Developing From the Command Line in Linux
tutorial,
Linux / Programming Languages / Software Development

An Introduction To Developing From the Command Line in Linux

This tutorial is a beginner's guide to writing code in Linux using just command-line tools instead of full-featured IDEs.
Nov 27th, 2024 11:00am by Jack Wallen
👁 Featued image for: An Introduction To Developing From the Command Line in Linux
Featured image via Unsplash.
When you think of software development, you probably assume all types of applications and services must be used to get the job done. You’ll need a powerful IDE, a GUI for version control, and a host of other tools. What if I told you that wasn’t the case? Back when I briefly studied C++, the professor informed us we’d have to purchase an IDE by Microsoft. Even though the student price for the software wasn’t terribly expensive, I didn’t have access to a Windows computer. Everything I did was within Linux, and I wasn’t about to change that. What was I to do? Like any good Linux user, I figured it out. To my surprise, it wasn’t all that big of a challenge. I had to install a few pieces of software (such as the GNU C/C++ compiler), but once that was taken care of, I was set. I started working on my first assignment, and all went well. In fact, in comparison to my fellow students, my process was considerably more efficient than theirs. Some complained that their computers weren’t powerful enough to run the IDE, while others had to overcome the learning curve involved with using such a powerful tool. For me, I wrote my code using the nano text editor, compiled it with gcc, and ran the app. It was incredibly easy. Here’s an example using Hello, World in C. The code is: Save the file as demo.c. Compile the application with the command:
cc demo.c -o demo
Run the app with:
./demo
The output will be:
Hello, New Stack!
It really doesn’t get any easier than that. But let’s take a step back and discuss what’s required.

What You Need To Develop on Linux

Obviously, you need a running instance of Linux. This can be any distribution because the tools will be available, no matter what flavor of Linux you use, from standard repositories. There are, however, exceptions to this. For example, the version of Java found in most standard repositories will be out of date, which means you’ll need to add a repository that includes the latest releases. What about other languages? Let’s take a look.
  • Python – pre-installed on most Linux distributions.
  • C/C++ – can be installed from the standard repositories. On Fedora-based distributions, it can be added with the command sudo dnf groupinstall ‘Development Tools’ and on Ubuntu-based tools, that command is sudo apt-get install build-essential -y.
  • Go – The Go binary can be downloaded from https://go.dev. Once downloaded, unpack the archive with a command like this:
  • sudo tar -C /usr/local/ -xzf goXXX.linux-amd64.tar.gz (where XXX is the release number). You then must set the path for Go by adding the following line to the bottom of your ~/.profile file:
  • export PATH=$PATH:/usr/local/go/bin.
  • Java – How you install Java will depend on the version you need, but you can install the default package from the standard repositories with one of these commands: Ubuntu – sudo apt-get install default-jdk -y or Fedora – sudo dnf install <openjdk-package-name>. You can locate the package you want to install with dnf search openjdk.
  • Node.js – On Ubuntu, install Node.js with sudo apt-get install nodejs -y and on Fedora, the command is: sudo :dnf install nodejs -y
As you can see, installing the actual programming languages is quite easy on Linux. You might also want to install a debugger for your language of choice. For example, you can use the gdb debugger for C, C++, Ada, and Fortran. If you need a command line debugger, do a quick search, and you’ll quickly find out if your language of choice has a command line debugger and how to install it. What’s next?

Choose Your Editor

I’m just going to say this: Nano has been my editor of choice for a very long time. I know it’s not the popular choice, but I find it never gets in my way of doing what needs to be done. That being said, most serious developers who use Linux tend to prefer the old-school (and supremely powerful) vi or emacs. The thing about both of those editors is they each have a learning curve. Let me explain the workflow for vi.
  1. Open a terminal window.
  2. Start vi with the command vi.
  3. Switch out of command mode into insert mode by pressing the i key on your keyboard.
  4. Type your code.
  5. Save and quit by first pressing the Escape key on your keyboard and then type :wq (for write/quit).
That’s just the very basic usage, and you have to go through that process every time you use vi. Here’s the same process with nano:
  1. Open a terminal window.
  2. Start nano with the command nano.
  3. Type your code.
  4. Save and quit with the Ctrl-X key combination.
With nano, there are few steps and fewer to remember. On the other hand, there are far fewer features. Because of this, I always recommend that new users start with nano, and once they feel as if they need more power and/or features, it’s time to migrate to vi.

Git ‘Er Done

At some point, you’ll need a version control system, especially if you work with a team. Fortunately, you can interact with Git from the command line, so there’s no need for a GUI there either. Git can be installed from the standard repositories, such as with the command:
sudo apt-get install git -y
Once you have Git installed, the basic command line workflow goes something like this:
  1. Create a new repository – mkdir ~/new-project
  2. Initialize the repository – git init .
  3. Add files to the repository – you can either copy them or create them from scratch.
  4. Connect the local repository with the GitHub repository with the command: git remote add origin URL (where URL is the address of the GitHub repository)
  5. Pull the content of the remote repository with: git pull origin master
  6. Create a README file and then add it with git add README
  7. Make your first commit with git commit -m “Added new information to README file”
  8. Push to send the changes to the remote repository with git push
Do note that you must create an access token from within your GitHub profile. You’ll also want to configure the global options with the commands: Where NAME is your real name and EMAIL is the email address associated with your GitHub account. Developing from the Linux command line isn’t nearly as challenging as you might think. Can you work this way at scale? Maybe.
TRENDING STORIES
Jack Wallen is what happens when a Gen Xer mind-melds with present-day snark. Jack is a seeker of truth and a writer of words with a quantum mechanical pencil and a disjointed beat of sound and soul. Although he resides...
Read more from Jack Wallen
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.