DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th January 2011
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 282
Thanked 5 Times in 5 Posts
Default find last or special command I run with /bin/csh

I use FreeBSD 8.1 Release AMD64 with Gnome and shell of root user is csh and shell of normal user is zsh .
in normal user when I press
Code:
Ctrl+r
I see this
Code:
bck-i-search: _
and for example when I type
Code:
ss
I see this
Code:
grep -i "the" messages
and I can find last command has ss .
this way is great and I can find last command I run it before very easy and fast and I can find all command I run before by type first letter
can I have something like this with root use and csh shell ?
I do not want change root shell and I want use csh .
__________________
http://www.mfaridi.com
First site about FreeBSD and OpenBSD in persian or Farsi.

Last edited by mfaridi; 8th January 2011 at 02:05 PM.
Reply With Quote
  #2   (View Single Post)  
Old 8th January 2011
classicmanpro's Avatar
classicmanpro classicmanpro is offline
Real Name: Turea Alexandru Teodor
Fdisk Soldier
 
Join Date: Oct 2010
Location: Romania (SE Europe)
Posts: 49
Thanked 1 Time in 1 Post
Default

Try TCSH(1). Both CSH(1) and TCSH(1) have a history mechanism but TCSH(1) has more features. If you read the TCSH(1) manual, the sections with a (+) denote the differences.
__________________
A daemon in need is a daemon indeed.

Last edited by classicmanpro; 8th January 2011 at 04:06 PM.
Reply With Quote
  #3   (View Single Post)  
Old 8th January 2011
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 282
Thanked 5 Times in 5 Posts
Default

but I do not want change my default shell
__________________
http://www.mfaridi.com
First site about FreeBSD and OpenBSD in persian or Farsi.
Reply With Quote
  #4   (View Single Post)  
Old 8th January 2011
classicmanpro's Avatar
classicmanpro classicmanpro is offline
Real Name: Turea Alexandru Teodor
Fdisk Soldier
 
Join Date: Oct 2010
Location: Romania (SE Europe)
Posts: 49
Thanked 1 Time in 1 Post
Post

Try the history built-in command and look-up the alias feature.

PS: The first thing I do after I reinstall my system is to copy .tcshrc in my $HOME and install TCSH(1).
__________________
A daemon in need is a daemon indeed.

Last edited by classicmanpro; 8th January 2011 at 09:32 PM.
Reply With Quote
  #5   (View Single Post)  
Old 10th January 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,070
Thanked 198 Times in 156 Posts
Default

Actually, csh and tcsh are one and the same on FreeBSD. /bin/csh is a hard link to /bin/tcsh (Check the inode).

Back to the original question, If you want zsh as root, but don't want to change the default shell, you can do is just start zsh by typing it after you used su to become root.

As for your history search command, as far as I know csh isn't able to do exactly that.

csh does have a more or less similar option called autoexpand. If you type ls it and press up, it will only show you the commands that start with ls.

IMHO tcsh is a fairly usable interactive shell, but many people are put off by the not-always-equally-sane default options.
Here is what I use, and would personally consider a slightly more sane cshrc:
http://rwxrwxrwx.net/csh.cshrc

Save it as /root/.cshrc overwrite the file that is already there.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.

Last edited by Carpetsmoker; 10th January 2011 at 09:34 AM.
Reply With Quote
  #6   (View Single Post)  
Old 10th January 2011
mfaridi's Avatar
mfaridi mfaridi is offline
Spam Deminer
 
Join Date: May 2008
Location: Afghanistan
Posts: 282
Thanked 5 Times in 5 Posts
Default

Quote:
Originally Posted by Carpetsmoker View Post
Actually, csh and tcsh are one and the same on FreeBSD. /bin/csh is a hard link to /bin/tcsh (Check the inode).

Back to the original question, If you want zsh as root, but don't want to change the default shell, you can do is just start zsh by typing it after you used su to become root.

As for your history search command, as far as I know csh isn't able to do exactly that.

csh does have a more a similar option called autoexpand. If you type ls it and press up, it will only show you the commands that start with ls.

IMHO tcsh is a fairly usable interactive shell, but many people are put off by the not-always-equally-sane default options.
Here is what I use, and would personally consider a slightly more sane cshrc:
http://rwxrwxrwx.net/csh.cshrc

Save it as /root/.cshrc overwrite the file that is already there.
if csh has better search for old command , it was better.
I use csh with root user
and I use ZSH with normal user . normal use use zsh and do not use csh
__________________
http://www.mfaridi.com
First site about FreeBSD and OpenBSD in persian or Farsi.
Reply With Quote
  #7   (View Single Post)  
Old 10th January 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,070
Thanked 198 Times in 156 Posts
Default

What that a question? Because if it was I didn't quite understand it (Sorry ... ).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find command (Linux options?) deadeyes FreeBSD General 11 23rd August 2009 06:07 PM
K3b cannot find growisofs maxrussell FreeBSD General 5 26th April 2009 12:20 PM
sorting special characters gosha Programming 15 9th April 2009 02:29 AM
Command to find and replace, but not creating a new file 18Googol2 Programming 4 22nd September 2008 10:28 PM
pkg_add g95;g95 x.f95: cannot find g95 enpey OpenBSD Packages and Ports 8 27th August 2008 12:48 AM


All times are GMT. The time now is 04:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick