Find the answer to your Linux question:
Results 1 to 4 of 4
i compiled my C program by typing: gcc -o test test.c then when I want to run the program by typing test it says that this command not found what ...
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Location
    France
    Posts
    2

    run a C program

    i compiled my C program by typing:
    gcc -o test test.c

    then when I want to run the program by typing
    test
    it says that this command not found

    what is the problem?

    Thanks

  2. #2
    Linux Guru Vergil83's Avatar
    Join Date
    Mar 2004
    Posts
    2,408
    try ./test.c
    Brilliant Mediocrity - Making Failure Look Good

  3. #3
    Just Joined!
    Join Date
    Mar 2005
    Location
    France
    Posts
    2
    Thanks for ur reply

    it works when i typed in ./test

  4. #4
    Linux Newbie
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    168
    The " . " stands for the current directory.

    Hence, ./test selects the test file in the current directory.

    If security isn't an issue, you can add ;. to the end of your path in the .bashrc file in your home directory.

    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •