Computing.Net > Forums > Solaris > Previous command

Previous command

Reply to Message Icon

Original Message
Name: Truc Nguyen
Date: May 3, 2006 at 10:02:16 Pacific
Subject: Previous command
OS: Solaris
CPU/Ram: 512
Comment:

Hi

In Unix, to get the previous command, I simply use the back arrow key on the keyboard to sroll back the history commands.

But Solaris does not have this action. Each time I execute a command, I have to re-type it. Do you know how to set up Solaris behave as Unix?

Thanks,


Report Offensive Message For Removal

Response Number 1
Name: sboffin
Date: May 5, 2006 at 11:47:48 Pacific
Subject: Previous command
Reply: (edit)

In Unix type "history".
to repeat the last command at the prompt type "!!"

If you want trun the latest command starting with a l (like ls -al) type "!l"

If you want to execute a command specific of the history not the number and type !<number>

In my cshrc I have
alias h 'history \!* | head -39 | more'

so that I can type only "h" at the prompt and it will list only the last 40 commands.

Hope this helps


Report Offensive Follow Up For Removal

Response Number 2
Name: Glitchman
Date: May 10, 2006 at 13:20:33 Pacific
Subject: Previous command
Reply: (edit)

Hit the Escape key, then lowercase k.


Report Offensive Follow Up For Removal

Response Number 3
Name: shipper99
Date: May 23, 2006 at 06:18:10 Pacific
Subject: Previous command
Reply: (edit)

If you use tcsh shell then you just have to hit the up arrow key to repeat last command.


Report Offensive Follow Up For Removal

Response Number 4
Name: amol_pali
Date: July 11, 2006 at 03:05:27 Pacific
Subject: Previous command
Reply: (edit)

Hi,
When u enter into terminal of Solaris u get
# prompt. Now type the shell u want to use
like if u want to use bash shell type bash.
u will get "bash-3.00#" prompt. Now this will work like unix simply press up arrow key to repeat previous commands.
I think u got your answer


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Previous command

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software