Could some let me know the command used to view the commands that I have entered 2 days ago. I am able to perform a command fc -l but its yielding me only last 10 recent events. I need to know the history of the commands that i have entered 2 days ago. Is there anyway that I can get the information that I am requesting for ?
What you have available to see via fc or shell built-in "history" command depends on the HISTSIZE variable. If HISTSIZE is set to 100, the history will only have the last 100 commands that you have executed. Depending on how many commands you execute per day, your history might not take you back very far.
Echo the value of HISTSIZE to see the number that the shell is keeping for you, and add the +nnn option (where nnn is a number) to see more than 10 commands. For example:
What you have available to see via fc or shell built-in "history" command depends on the HISTSIZE variable. If HISTSIZE is set to 100, the history will only have the last 100 commands that you have executed. Depending on how many commands you execute per day, your history might not take you back very far.
Echo the value of HISTSIZE to see the number that the shell is keeping for you, and add the +nnn option (where nnn is a number) to see more than 10 commands. For example:
should show the last 300 lines
Thanks for such a prompt response.
How can i view the HISTSIZE. When I am trying to hit the cmd
$echo HISTSIZE - displays nothing.
And fc -l +300 displays the following
ksh: +300: not found
HISTSIZE is a shell variable, so this command is needed (you were close):
The message from Kshell is odd. What version are you running? (run the command echo ${.sh.version} to find out. It should give you something like Version JM 93u 2011-02-08 and if it doesn't (or gives you an error) you have a pretty old version of Kshell installed.
In recent versions of Kshell, fc is an alias for hist which is a built-in command. The Kshell doc doesn't mention support for +n, however it is working for me in all of the versions I have installed, the oldest is from 2009.
My gut feeling on this is that your Kshell is old and the in built command doesn't support +n.
Which should list all of the commands in the hist file stripping away any non-printable characters that Kshell adds.
It also occurred to me that your history might be deleted each time you log in, or might be placed into a different file for each login session that you have. Might make finding the right file, if it still exists, a bit of a challenge.
I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX.
The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (1 Reply)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (3 Replies)
Hello every body,
Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris??
To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time.
FYI I used... (5 Replies)
How do you get your recent vi command history to show up? I keep randomly getting like my previous 5 commands and can't figure out how I'm doing it. I think it has something to do with the shift key and another button. (6 Replies)
Hi people,
Please some help over here.
I have logs in a directory, in which I need to get the most recent file in order to put it within other command.
The format of the files are
loadfiles20090308094339_41
loadfiles20090308094418_42
loadfiles20090308095457_43... (4 Replies)
I have a set of values like this and sometimes more
source5local_02Dec2008
source5local_01Nov2008
source5local_05Sep2008
I need to retrieve the string with the most recent date
if I cut the date value from each of these strings is there any means to compare them (3 Replies)
Hi all,
I'm running on a Sun Solaris machine. I would only want to keep the last 2 most recent files on 1 of my directory.
Below shows my script, but it is incomplete. For the ?? part I do not know how to continue. please help:confused:
DIR=/tmp/abc
OUTPUT=/tmp/output.out... (1 Reply)
Hi,
I have files coming in every day with that days timestamp like:
nameyyyymmddhhmmss.ext.
I need the most recent one and so i am using
cat `ls -t name*|head -1 ` > temp
i am sorting the files in the decending order and am copying the most recent one into a temp file.
It works at times... (3 Replies)