3

I'm just scrolling through all the commands i have recently used in computer which is running Ubuntu. I have found one line which looks like blank but i'm not sure about it it contains star right after the number of the command.

After using command history in terminal, It looks like this:

68 another command
69 another command
70 another command
71*
72 another command
73 another command
74 another command

what does this line mean?

71*

what command is hidden in this line ?

  • You may have typed * and hit Enter. Screamy bold is so annoying, by the way. – mikewhatever Aug 26 '16 at 17:52
  • i have tested that that was the first thing that came into my mind , doing this will produce 71{space}* and not 71* there is difference – Tomas Aug 26 '16 at 17:53
  • @mikewhatever Nope, thats shown when a command is modified after retrieving from history. – heemayl Aug 26 '16 at 17:53
  • heemayl how could i do it ? i have no idea – Tomas Aug 26 '16 at 17:55
5

This occurs when you retrieve an entry from history list by history expansion or using arrow keys and modify the entry.

From help history:

Display the history list with line numbers, prefixing each modified entry with a `*'.

So in your case as the command field is null, you have retrieved that entry from history file/buffer and made it null by removing the command altogether i.e. the modified command will be shown.

  • and if i didnot do anything like this , should i be worried of some kind of intruder on my system? – Tomas Aug 26 '16 at 18:10
  • @Tomas Yes, absolutely as history expansion works only on interactive sessions unless you tell bash otherwise. – heemayl Aug 26 '16 at 18:11
  • its strange i have just reinstalled the system and used like 3 commands to create a new directory and create a text file to make my own notes, maybe i did it but i dont remember i dont exactly understand how you described the proccess of doing it – Tomas Aug 26 '16 at 18:14
  • ah i know the problem is that i used arrow up to use previous command but i added something to the end of the command , everything is ok , no intruder , case solved – Tomas Aug 26 '16 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.