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

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



A script to do that?

grep cd\ /home  .bash_history  > some-file


Roger
----- Original Message -----
From: "Huck" <dhuckaby paasda org>
To: "Support list for open source software in schools." <k12osn redhat com>
Sent: Thursday, December 11, 2008 10:24:03 AM GMT -08:00 US/Canada Pacific
Subject: [K12OSN] Most Bash scripting questions? :)

I cat a file...   .bash_history in this case.

it has...

ls
cd RadioMadness
ls
cd /home/torkch/profile/Desktop/
ls Research\ Paper/
rm -rf Research\ Paper/
ls
rm Thumbs.db
cd /home/wincst/
ls
ls Physics/
rm -rf Physics/


for examply...


I want to strip out and KEEP... all lines that say

cd /home/

and keep that in a separate file...

Thanks for the help you Lovely Bash Script Gurus!!!

_______________________________________________
K12OSN mailing list
K12OSN redhat com
https://www.redhat.com/mailman/listinfo/k12osn
For more info see <http://www.k12os.org>


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