General :: Delete Bash Terminal History Upto Certain No. Of Commands?
Jan 12, 2010i want to delete some say 10 previous commands in bash shell!
View 3 Repliesi want to delete some say 10 previous commands in bash shell!
View 3 RepliesIs there a way to get the bash history to delete older entries that are identical to the new one?Say the bash history would look like this normally:
Code:
cd ~
ls -l
[code]...
Having recovered from busting my installation, feel urgent need to know what I did to set it up.So...would like to see all commands I ran in terminal window and store them (execute as script in future?)I can see prior commands using up arrow, is there a way of storing all of those commands in history?Also, any pointers to setting up sort of backup of the package installation setup?
View 7 Replies View RelatedWhat's the command to delete bash command history?
View 4 Replies View Relatedterminal i open i have no history; the history is kept only in that terminal and is gone when i exit the terminal.If I count lines:as a user:
Code:
$ wc -l .bash_history
wc: .bash_history: Permission denied
[code]....
$ execute_some_long_command <command is executing> <Accidently press middle button that inserts bunch of garbage (including, for example, `rm -Rf ~/*`) into console>
How to let execute_some_long_command finish, but not execute inserted things?
i am working with linux security auditing project on my Servers.I want to find out all the commands executed by individual users.i think using last command,find out the login details.But how can find out the commands executed by each users on all logins except "history".?
View 2 Replies View RelatedIs there any commands or scripts to remove only selected line in the history file.
View 1 Replies View RelatedSuppose when I issue history command it is showing 100 entries with number attached to each command executed.
how to edit the history to remove few commands executed by me so as to protect the system from other users.
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
I am working on a x86 target running fedora 9.
Whenever I reboot it, my history returns to some state, and I do not have commands I did in the sessions before the reboot.
What I have to change to have updated history I had before reboot?
In my organization, we have a centralized home directory for all users which gets mounted from all the machine where user logs in.Since any XYZ user can login to any of hundreds test machines and run 'sudo su - myusername', hence taking control of my home dir.How do I track who took control of my home dir and deleted its contents.
View 3 Replies View Relatedwhat command do i use to copy .bash_history to /tmp location?
View 9 Replies View RelatedIs there a way to define an unlimited history in Bash ?
View 3 Replies View RelatedPossible Duplicate: Can history files be unified in bash? I have bash running in an ssh session, call this session A. I leave the office, go home, ssh to the same box, call this session B. From session B, I'd like to be able to look at the history of session A.
View 1 Replies View RelatedHow can I get/filter history entries in a specific range?I have a large history file and frequently usehistory | grep somecommandNow, my memory is pretty bad and I also want to see what else I did around the time I entered the command.For now I do this:get match, say 4992 somecommand, then I do history | grep 49[0-9][0-9]this is usually good enough, but I would much rather do it more precisely, that is see commands from 4972 to 5012, that is 20 commands before and 20 after. I am wondering if there is an easier way? I suspect, a custom script is in order, but perhaps someone else has done something similar before.
View 2 Replies View RelatedI would like to keep track of not only what bash commands I used and when, but also where they were issued from, i.e. what was the current working directory when I issued "foobar" on a particular day and time. Can we ask bash history to keep track of working directories too? I have tried to get an idea of this reading the enormous "man bash", but I don't seem to have an answer yet either way.
View 11 Replies View RelatedIs it possible to use the keyboard in order to select some text in the terminal windows that is not in the currently edited line? (for example, in order to copy part of previous command output).
View 3 Replies View RelatedI noticed a few days ago, that history feature is not working on my ubuntu 10.10 notebook edition terminal. I mean I enter a bunch of commands today and then shut down. Come back again tomorrow and turn on the machine and open the terminal, but up and down arrows won't bring any old commands that I used today.
View 14 Replies View Relatedi use ncftp for some bash script action. how to delete oldest directory and oldest file using ncftp commands?
View 3 Replies View RelatedIf I interactively ssh to a remote host and enter commands, I can up-arrow through the command history.If a script ssh's to a remote host and calls a command, it does not get appended to the history.How can I configure ssh or sshd so that this happens? I'd like to be able to have those scripted commands available in the history file when I log back in interactively.
View 2 Replies View RelatedWhat happens when the script executes is that the ssh connection works and parks me at the remote hosts's shell login. Therefore, the "firefox" command refuses to execute. I need to know how to make the "ssh" connection occur, stay open, and go into the background so that the rest of the script can execute.If I could also do this with the "firefox" line so that the entire term window could be closed would also be helpful.
View 3 Replies View RelatedI'm using RHEL 5.0 and i want to delete history for n users at a time.i can use history -c from each user login and delete but i want another way.or i want to create a shell script by using which i can do d task at a glance for all users.
View 1 Replies View RelatedI would be running SQL commands (UPDATE/SELECT) from within my bash script. I am completely new to this subject. Is MYSQL used for this purpose? Alternatively, what is sqlplus?
View 6 Replies View RelatedWhat command is used to delete input command history in terminal ?I am afraid my friend will trace what been inpu
View 10 Replies View RelatedI know CD, Apt-Get, and Dir, but besides that I know mostly Command Prompt commands and that's not many, and they seem to differ from Terminal. What are some useful Terminal commands that I should know how to use in times or need?
View 3 Replies View Relatedi have RHEL4. i m facing problem that all the previous command history is deleted when i restart the server or relogin the server. it is happening with all the users not with any one user.
View 2 Replies View RelatedThis is a really odd bug I can't seem to figure it out. Basically, commands like ls can see all the files in the current directory, however when I go to execute the file it will give errors like "file not found", even when it most obviously is. If you look at my command history in the screenshot, you can see I can ls into a directory and see it's contents. When I try to run the file, I get the "no such file or directory" error.
However, if I type simply 'vm', I can't use tab completion to complete the directory name, and my third command is me typing 'vm' and hitting tabtab, it lists a bunch of vmware specific tools instead of the subdirectory name. I can then ls and see my current directory contents, and it will list only the single subdirectory. However, then I tried to use the full filepath from root to run the file, still to no avail. If anyone has any insight,
is there any way I can pass commands to the CLI of a tool directly?
I would like to script some actions, for example:
./OpenBTS < "tmsis"
I do not need to retrieve the results (I watch it in the log file). how I could realize that? There is now way to do this using command line parameters, at least not that I found out. So it looks like I have to figure out sth myself. Maybe I could automate screen in a way to detect the prompt and "paste" my command there. Are there tools for this on Linux?
Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
View 3 Replies View Related