The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with AWK -- quick question Probos Shell Programming and Scripting 5 07-18-2007 04:26 PM
quick question keith.m AIX 5 12-21-2006 09:27 AM
quick sed question vbm Shell Programming and Scripting 2 11-09-2006 10:44 PM
quick question pkolishetty UNIX for Dummies Questions & Answers 2 09-02-2006 11:56 AM
Ok quick question Corrail Shell Programming and Scripting 1 11-11-2005 01:49 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-20-2001
Tracy Hunt Tracy Hunt is offline
Registered User
  
 

Join Date: Feb 2001
Posts: 1
Question

I know in DOS, when you want to pull up your last/previous command, you hit the up/down arrows. How do you do that with UNIX?
  #2 (permalink)  
Old 02-20-2001
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,661
That is a function of the shell and the command line editor you are working in/with. I work in KSH so I set my EDITOR environmental variable to <B>vi</B> and have the entire range of vi search and replace on the command line. This is the same as all the vi commands in a file. For example, to move forward a line: <ESC>j ; backwards: <ESC> k. To search for a command: <ESC>/string . This is very powerful and fast (much more powerful than DOS, BTW).

Other use EMACS as the command line editor.

Also, differnet shells have builtins that do not require using a command line editor. For me, I could not imagine not using vi or emacs on the command line. The power is amazing.
  #3 (permalink)  
Old 02-20-2001
petrosi petrosi is offline
Registered User
  
 

Join Date: Feb 2001
Location: New York CIty
Posts: 3
repeat previous UNIX command

Oh wow, something that I can answer.

at a command prompt, type ksh
this will get you to the other shell if you are currently in the bourne shell.

then type in set -o vi

To test things out, type in a command and execute.
To repeat this command, press the ESC key. Then use the
j and k keys to scroll through the old commands. After you execute the old command, you will have to press the ESC key again to get to the old commands.

You can, also, edit the old command as though you were in vi editor..
  #4 (permalink)  
Old 02-20-2001
98_1LE 98_1LE is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
Another shell, bash (often installed in /usr/local/bin/bash), allows you to scroll through the command history with the up/down arrow keys. Bash is typically installed in Linux or Solaris 8 machines but can be added to most UNIX flavors. To see if bash is on you system, execute;
which bash

or

ls /usr/local/bin/bash
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0