This is a tutorial about some important Linux commands for developers. Every Linux distribution like Ubuntu, Fedora, RedHat, CentOs etc. comes with shell commands. Knowing some of important Linux commands is a beneficial for a developers who program for Linux based application. So let us discuss some of them.

Some important Linux commands for developers

  • file command

The file command is used to determine a file's type. For example if we want to
know your executable type that is whether is build for x86 or build for arm,
we can run `file "name of file" `
  • pwd command

pwd command is known as present working directory. pwd command print full path of working directory.

bosch@bosch-Inspiron-N5050:~/myproject$ pwd
  • ls command

ls command print contents of current working directory.
bosch@bosch-Inspiron-N5050:~/myproject/sample/gtk$ ls
mediapla.c  mediapla.c~  wikiplayer
  • pkg-config linux utility command

pkg-config is linux utility or tool which read meta data stored in .pc files. Suppose you are going to write simple application using gtk library.gtk is GUI toolkit used by gnome linux desktop. if you don’t know the exact name of library you can list down by executing pkg-config –list-all.

#include <gtk/gtk.h>
int main( int argc, char *argv[])
GtkWidget *window;
gtk_init(&amp;argc, &amp;argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
return 0;

save this code in file win.c, and compile it by below command
gcc -o win win.c pkg-config --libs --cflags gtk+-2.0

The command pkg-config --cflags will give header information while pkg-config --libs gives library linker flags

  •  find command in Unix/Linux

find command is powerful utility of Linux/Unix. It is used to search a file in a directory hierarchy. Let us assume we have terminal window like below

Some important Linux commands for developers

Look at the above sample terminal window. The current working directory is “myproject“. we have run command “find -iname main.c“. Here find commands prints full path of file main.c in all the child directory. Find also searches file in current directory. -iname is switch which directs the find command to search file main.c with case insensitive.

  • grep command

In linux based system grep command is most important command. grep is used to find a string in a file. The full name of grep command is global search for regular expression and print. following sample command will search “stdio” in all the files from working directory and if a file contains string “stdio”, the full path of file would be printed with line number.

bosch@bosch-Inspiron-N5050:~/myproject/sample$ grep -inr stdio .

The . means current working directory.

Related Contents to follow