[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Most Bash scripting questions? :)



Huck wrote:

was more about stripping out...but either of those will work fine
I can bastardize another script to rip 'em out...

Copy the lines with 'cd /home/' in .bash_history to a separate file:

	$ grep 'cd /home/' .bash_history > separate-file

Delete the lines with 'cd /home/' from .bash_history (the forward slashes in the path need to be escaped):

	$ sed -i -e '/cd \/home\//d' .bash_history

Note that the '>' overwrites the contents on any existing 'separate- file'. A new 'separate-file' is created if it doesn't exist yet. If you want to append instead of overwrite, use >> instead.

Nils Breunese.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]