Run Linux Command

#include<stdlib.h>

int main() {

	/* System function use to run system commands */
	/* Print date on the terminal */
	system("date");

	/* List directory content on the terminal */
	system("ls");
	return 0;
}




/* Output */
Sat Aug 30 10:09:04 IST 2014
ab.txt
file.txt
program.c
programming.c

Comments (0)

  • To add your comment please or

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.

Got It!