help with simple terminal commands


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers help with simple terminal commands
# 1  
Old 01-14-2011
Error help with simple terminal commands

i am at home with a windows xp home, and i am using putty terminal to access my linux mathlab account, my task is to compile and run a C program, called a.c,

i used
Code:
gcc -Wall -g -o mycode a.c

to compile it into a mycode file

now when i want to run it, i was told i had to use

Code:
$ mycode

or
Code:
$ ./mycode

but both of these dont work. How do i run the file now?

thanks

Last edited by DukeNuke2; 01-17-2011 at 05:44 PM..
# 2  
Old 01-14-2011
To check if the executable exists
Code:
ls -al mycode

If the executable bits are not set, use chmod to set them i.e.
Code:
chmod 755 mycode

# 3  
Old 01-17-2011
Another question ... what is the program supposed to do?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Creating terminal commands

I've written a program in C, called count_0.1 which is essentially a word count program. I want to be able to use it as a command in the terminal (by typing in count), like when you type in ls, you don't have to go to a directory, find an executable and type in: ./ls I've tried: Adding... (1 Reply)
Discussion started by: usernamer
1 Replies

2. Shell Programming and Scripting

How to save and execute terminal commands in shell?

I frequently use some commands, which I want to save in some file say myregularshell.shthese are the commands I use, I tried saving and executing, but couldn't get the preview of execution, and result is also not coming if I copy same commands and paste it on terminal result is coming cd go... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

3. Programming

C terminal commands

Hi I am trying to modify a C program to work for my needs. Problem is I don't know any real programming. I would really appreciate it if someone could help me! Basically it is to get bandwidth speeds from a remote box. I have two terminal commands that get me the up and down speeds. So how do... (8 Replies)
Discussion started by: milestails
8 Replies

4. OS X (Apple)

Terminal autorunning commands at start

How do I make terminal autorun commands at start up? For example, I have several windows of terminal, I want one to automatically run 'top' and a couple others autorun 'man' pages. Is there any way I can do this? (1 Reply)
Discussion started by: randomtypos
1 Replies

5. Shell Programming and Scripting

Replicate history commands in multiple terminal

Hi, I am using putty client to connect to my remote Linux server box, and I am connecting through ssh. That system runs bash shell. So, if I use multiple putty terminal, how can I replicate those commands that I ran in other terminals to be available/shared in the current terminal window (i.e)... (1 Reply)
Discussion started by: royalibrahim
1 Replies

6. Shell Programming and Scripting

commands in the terminal

hi.. I have a small question...if I have a textfile..let say apple.txt and I want to 1. search for all strings that's 6 characters long, and contains the letters a,b,c,d. 2. search for all words that that begins with "sUn" and ends with "flower" 3. search for all the words beginning with the... (3 Replies)
Discussion started by: Oregano
3 Replies

7. Cybersecurity

How do i find all the commands entered by root on any terminal

Can any one help me with a script, which runs in background and mails me all the commands entered by root on any terminal for every hour. We have multiple people having root access on the server and creating a mess,i just wanted to monitor all the activity of the root. (13 Replies)
Discussion started by: vishnu787
13 Replies

8. Shell Programming and Scripting

Displaying a dialog box using terminal commands

Hello, I used the command osascript -e 'tell app "Finder" to display dialog "Hey!"' to display a dialog box..it works fine, it displays a dialog box with 'OK' and 'CANCEL' buttons..i want to get the button returned value how can i do that using terminal command? is there any command to get... (1 Reply)
Discussion started by: keshav.murthy@r
1 Replies

9. UNIX for Dummies Questions & Answers

Terminal Commands

Hi there. Linux newbie and I'm trying to find commands to: Display number of executable files in a directory that i supply and list them in alphabetical order Back up all the files in the current irectory to a directory i supply, creating that directory if it's not allready there Cound... (5 Replies)
Discussion started by: indigoecho
5 Replies

10. UNIX for Dummies Questions & Answers

simple commands

Can anybody help me how to display a list of unix commands. I have an account in unix,just start to use it, but don't know how (1 Reply)
Discussion started by: aningsabah
1 Replies
Login or Register to Ask a Question