Beginners – Executing Commands & Command Syntax

Valic —  December 4, 2012 — Leave a comment

The Command PATH:

Most common commands are located in your shell’s “PATH” meaning that you can just type the name of the program to execute it.

Example:  Typing “ls” will execute the “ ls” command.

Your shell’s “PATH” variable includes the most common program locations, such as /bin, /usr/bin, /usr/X11R6/bin, and others.

To execute commands that are NOT in your current PATH, you have to give the complete location of the command.



./yourprogram  (This will execute the program in the current directory)


Command Syntax:

Commands can be run by themselves or you can pass in additional arguments to make them do different things. Typical command syntax can look something like this:

command [argument] [-argument] [--argument] [file]


  • ls –    List files in current directory
  • ls -l   Lists files in “long” format
  • ls -l –color As above, with colorized output
  • cat filename     Show contents of a file
  • cat -n filename Show contents of a file, with line numbers


Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

No Comments

Be the first to start the conversation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.