In Solaris(command Line ), How to get the previous commands?
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
The default shell (/bin/sh) which is the original Bourne shell doesn't has this feature.
You need to switch to a shell providing command history, like bash, ksh or zsh.
After you have created an ordinary account (which has bash shell), you can use arrow up, and also write "history" and you will get a list of old commands. Like:
1 ls -la
2 cat kebap.txt
3 cat orvar.txt
then you can write
!ca
and press enter, then it will execute the latest command that started with "ca" which is "cat orvar.txt" in this case.
& jlliagre you are 100% right i am using only root login for my past 1 year in Debian & now that is continuing in SUN also..Thanking you for leading me to the right direction,
Arun
( Yesterday i just typed #bash(accidently) in command prompt , after that i am getting the history)
This command appended a line in /etc/auto_home , but for other uses ,we are manually updating this line, for this user(kcarun) the line is differ from others?
Quote:
bash-3.00$ cat /etc/auto_home
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)auto_home 1.6 03/04/28 SMI"
#
# Home directory map for automounter
#
+auto_home
sindhu localhost:/export/home/sindhu
guest2 localhost:/export/home/guest2
joshy 127.0.0.1:/export/home/joshy
* -fstype=lofs :/export/home/&
bash-3.00$
3)"/usr/sbin/automount -v" is used for what purpose?
This command appended a line in /etc/auto_home , but for other uses ,we are manually updating this line, for this user(kcarun) the line is differ from others?
The line I append is equivalent to the one you had with these differences:
- lofs is faster than nfs
- it works for all users, no need to specify one line for each one.
Quote:
3)"/usr/sbin/automount -v" is used for what purpose?
(The profile files are used to setup the environment (PATH, etc) once and for all for each new user, and then every new user will use the environment you just setup. If you dont do this, every user has to setup for instance, the PATH variable)
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
If you followed the instructions I posted, you are granted the "Primary Administrator" role.
You can run any command as root by prefixing it by "pfexec".
bash-3.00$ who am i
kcarun pts/4 Aug 4 18:59 (:0.0)
bash-3.00$ pfexec ifconfig
ifconfig: Command not found
bash-3.00$
At the time of creating this user i am suspectingthat I changed the below selected part as "Primary Admin", that is only a description of the user or it is the critical part of the command?
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by kcarun
I tried pfexec method, but it is not working.
Your test didn't demonstrate it worked or not but just that ifconfig isn't in the PATH. You should have run "pfexec /usr/sbin/ifconfig ..." instead.
A simple test to check your settings:
Code:
$ id
uid=10000(jlliagre) gid=10000(jlliagre)
$ pfexec id
uid=0(root) gid=0(root)
Quote:
At the time of creating this user i am suspectingthat I changed the below selected part as "Primary Admin", that is only a description of the user or it is the critical part of the command?
It is indeed critical.
Quote:
How can I findout the rights of the user(kcarun) ?
The profiles precisely:
Code:
$ profiles
Primary Administrator
Basic Solaris User
All
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.