For example, my octave prompt is showing line number 7 octave...:7>
Is there a way to delete 4th line so that now it shows 6.
Or can I cancel all my previous lines and reset this counter?
First, I don't believe it is possible.
Second, why would you want to? The counter (AFAIK) is there simply as a way to identify the line you're on usually when debugging something. Particularly at the prompt, it doesn't serve much of a purpose (I think you can hide it, but I don't know the details).
I think you have a misconception of how the prompt works. After you type in a command, say:
octave:1> a= 5;
Then octave creates a variable called "a" that is assigned the value 5. Then that variable is available to use as you see fit, but the line itself has executed and gone (well except as an entry in the history). You could undo the line in some sense by clearing the variable like:
octave:2> clear a;
but this isn't what (I think) you mean by "deleting" a line.
Perhaps you could clarify what you're trying to do and why?
Yes you are right, I am just starting learning octave and how this prompt works.
Thing is octave remembers what I entered previously so there must be a way
to rewrite or delete it from octaves memory.
(EDIT) Does "clear a;" just does a:=0 ,or does it frees memory and no a anymore?
I just want to learn about prompt before I use editor(notepad++) for coding.
There are few prompts I encountered.
DOS type where command is executed and nothing is related to the next command.
Old Commodore prompt which remembers everything by line number, and you
manipulate everything by line number.
You can change the prompt and remove the line numbers, if you wanted to do that for some reason.
You need the command:
PS1('What you put here becomes the prompt')
This might be illustrated in the following lines. For each case, I have made the change then pressed return once to see the new prompt without a command. Note the requirement for quotation marks, and for the need to insert spaces or other characters, such as the >, if required (I forgot with one of the changes so that the prompt collided with the command, which is obviously not very sensible).