Interactive Fiction is a term used to refer to works where the player interacts with the story via text commands.
An IF will usually give some sort of description of the scene that faces the player, the player can then interact with it using simple commands, most usually of the form VERB OBJECT. The IF will then respond with a description of the results of the intereaction.
You are standing in a dark room, empty apart from a wooden table. On the table there is a sandwich.Player:
It's a ham sandwich.Player:
You eat the sandwich and almost immediately regret it. A strange rummbling eminates from your belly.Wikipedia Article on Interactive Fiction