History is located in .bash_history.
However, I am wondering if it is backed-up anywhere else.
In other words: if I delete .bash_history, can I display my historical commands from somewhere else for example a backup file?
Thanks.
Hi all,
I am working on SunOS bash shell. Whenever I see my
Code:
history
by typing it, I can see commands executed till now.
Is there a way to delete a line containing something and the blank line at the same time?
If you do this it leaves a blank line behind.
Code:
sed '/yum/d' .bash_history
I know this works but I would think there would be a way to do it with one command
Code:
sed '/yum/d' .bash_history | sed '/^$/d'
In vi this also leaves a blank line behind.
I want to see all bash commands that have been run on a Linux server across multiple user accounts. The specific distribution I'm using is CentOS 5.7. Is there a way to globally search .bash_history files on a server or would it be a more home-grown process of locate | cat | grep? (I shudder just typing that out).
a directory was moved with mv command in a Linux box, what logs should be looked at for such action? in root bash_history i can see the command was used, unfortunatly bash_history was not recording time & date, therefore making it difficult to trace.
Regards and thanks.
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
[The thing is , here we have a number of employees working in root permission.!!! And we are not actually getting who is doing which command and all...]
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a.
avraamjack - Welcome to the CentOS fora fellow Virginian. Please see the recommended reading for new users linked in my signature.Thanks for the suggestion, but it does not seem... [by pschaff]
Moderators,
Please excuse if I am in the wrong section.
I have a question that someone may know the answer to. We know that a current bash shell keeps a record of all commands in a buffer. When the shell is terminated this buffer is written out to ~/.bash_history for the user.
I know that in the current shell, you can access this buffer by using ctrl r for reverse history.
Linux offers a lot of power to users, especially from the command line. Because of this, some of the commands can get long and hairy. It would be nice to have a way so that you didn’t have to type those long ones out every time. Also, wouldn’t it be great to be able to search through your command history for that one really cool one? Luckily, we have some ways to do these things.