Home » NO IDEA » system call

system call

Blog Stats

  • 15,880 hits
April 2013
M T W T F S S
« Mar   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

today we are going to see about executing the Linux command through system()

we are using the ls command and the change directory command , we combined the command using the &&

#include<stdio.h>
#include<stdlib.h>
int main()
{
printf("\n using the list command in c");
system("cd /home/ganesh && ls");

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: