Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming via the terminal (Mac)

Tags:

c

terminal

macos

I have been using Textmate for writing my C source but want to do everything via the terminal.

How does one program via the terminal? Is anything else needed, installed?

like image 426
some_id Avatar asked Apr 17 '26 05:04

some_id


1 Answers

In order to write source code on the Terminal, you will of course need an editor that works on the Terminal. In OS X, you have a lot of options to choose from. If you want simple and easy to use editors, you may want to try nano and pico that are available on OS X. If you start to want a little or more functionality out of the text editor, then you may want to try editors like vim and emacs, which are also available under OS X.

In order to compile your C source, you will require a C compiler. While OS X does not, by default, come pre-installed with a C compiler, you can quickly install a slew of development tools that are available in the OS X installation discs that you may have got when you bought your Mac. Those tools will provide you with gcc -- which is the GNU C compiler that you can use on the Terminal to compile your C sources --, gdb -- which is the GNU Debugger that you can further use to debug your compiled C source --, make -- which is GNU make, a program that, when you start to have to manage a number of C source files, can help you by creating make files and automating build operations -- and a number of other tools that you may want to explore as you spend more time with the system and become familiar with it.

like image 162
ayaz Avatar answered Apr 18 '26 23:04

ayaz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!