Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Important and handy tools and commands while developing C applications in Linux [closed]

Tags:

c

linux

I have had experience using Visual Studio till now. But I am intending to use a few Linux tools to develop and maintain applications which are written in C.

I went thorough this question but it talks too much about the IDE's. I am happy to use them but I wanted to know which other tools are handy and important for the above excercise. I would also like to know incase there are any commands which would make things easy. Thanks!

EDIT: I have used vim and familiar with gcc and its important flags. anything further would help.

like image 619
Shash Avatar asked Aug 14 '12 13:08

Shash


1 Answers

You will want to familiarize yourself with the linux command line tools. In particular:

  • Learn a good editor such as vim or emacs
  • Script your builds using make
  • Compile using gcc
  • Debug using gdb
  • Source control: if you have the luxury of choosing one, I recommend a modern DVCS such as git or mercurial. Otherwise whatever tool your team is already using should be fine.

This is just scratching the surface of the essentials, but it may help you get started.


These tools are also very useful:

  • grep - You need a good way to search through source files. This command is integrated with vim and emacs (?) so you will probably want to use it directly from your editor in most cases.
  • ctags - As others have said, this will make it much easier to navigate through your source code from your editor. Again, consult your editor for exactly how to work with ctags.
  • valgrind - To find memory leaks in your application.
  • lint - A static analysis tool such as splint to find coding mistakes in your C code.
  • rpm or another packaging system - Depending upon how you will deploy your application, you may want to use a package manager to help with versioning, install/upgrade scripts, etc.
  • screen - A terminal multiplexer allows you to split up your terminal so you can (for example) look at your source code in one pane and debug/execute/search logs in another. This is also handy if you have to connect to any remote machines your are supporting, since if you happen to get disconnected you can just reconnect to your remote screen session later, without having to worry about all of your commands being terminated. For example, if you are in the middle of a yum update you do not have to worry about it being terminated mid-transaction just because your connection was severed.
  • ssh / sftp / etc - To securely copy files to your test/production machines, if necessary.
like image 129
Justin Ethier Avatar answered Sep 18 '22 00:09

Justin Ethier