Define shell variable HISTIGNORE so that comments (lines starting with #) appear in shell history

export HISTIGNORE=' cd "`*: PROMPT_COMMAND=?*?'
I was surprised to find that with RedHat bash, I could not find any comment lines (begining with #) in my bash shell history. Surprised because in Mageia Linux this works. It turns out that RedHat's bash will keep comment lines if in my .bashrc, I define: export HISTIGNORE=' cd "`*: PROMPT_COMMAND=?*?' Why have comment lines in shell history? It's a handy and convenient way to make proto-commands (to be completed later) and for storing brief text data that is searchable in shell history.
Sample Output
$ export HISTIGNORE=' cd "`*: PROMPT_COMMAND=?*?' ; exec bash
$ # store some text here
$ history | tail -3
 1000  export HISTIGNORE=' cd "`*: PROMPT_COMMAND=?*?' ; exec bash
 1001  # store some text here
 1002  history | tail -3

1
By: mpb
2011-10-18 19:58:39

What Others Think

Command linefu is a website that has information about the shell variable list ignore. Here you can check assignmentholic.co.uk and get more help to solve your study problem. You can post your commands in front of their Magaña Linux this works. You can go for the record those command-line gems that you return to again and again. Join it for more.
Randy45 · 48 weeks and 6 days ago
This website was really suitable for students who wish to learn the commands. Through commands the tasks uselegalcbd.com are done so perfectly and no need to write long codes for that like programming languages. I am expecting more such details from here. Keep up the good work.
Alyssalauren · 24 weeks and 4 days ago
Mostly I used these good commands notepad on windows 10 for get new information easily.
samkarol · 12 weeks and 6 days ago
I was impressed with the site that you created, so memotipasi many people to be more advanced, there also kunjugi me, as a comparison N95 mask
jackson2321 · 7 weeks and 6 days ago
Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. ????
jackson2321 · 7 weeks and 2 days ago
Coal-Based Activated Carbon, Wood Activated Carbon, Nutshell Activated Carbon, Coconut Shell Activated Carbon, activated carbon manufacturers activated carbon manufacturers
jackson2321 · 7 weeks and 1 day ago
Good place, walked into the future together with bookmarked as their favorite your websites. That i can’t procrastinate to read the paper even more with everyone. onewalmartone
KayGasaway · 6 weeks ago
I was impressed with the site that you created, so memotipasi many people to be more advanced, there also kunjugi me, as a comparison http://payslipview.pro/
KayGasaway · 5 weeks and 3 days ago
Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! https://www.payslipview.pro/
KayGasaway · 5 weeks and 3 days ago
This unique is a fantastic put up I just spotted using show it again. Suggest whatever I wanted to ascertain optimism through forthcoming you are likely to remain for the purpose of showing this terrific put up. new token event
KayGasaway · 4 weeks and 5 days ago
NYC Popcorn Ceiling Removal has a lot of comments in their website. I will definitely apply this!
MarkMatthews · 4 weeks and 5 days ago
I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! Antminer-t19 84th
KayGasaway · 4 weeks and 4 days ago
I have a hard time describing my thoughts on content, but I really felt I should here. Your article is really great. I like the way you wrote this information. monsieurpharmacien24.com/
KayGasaway · 4 weeks and 1 day ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. commercial flat roofing
KayGasaway · 4 weeks ago
Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. streaming sans compte
KayGasaway · 3 weeks and 5 days ago
Nothing compares to Weber using Genesis sort of grills. That is certainly the type gas grills which have been that will always make sure that they deliver a high performance part of down interval http://instachatbot.io">shopify chatbot
jackson2321 · 3 weeks and 4 days ago
Intriguing post. I Have Been pondering about this issue, so much obliged for posting. Really cool post.It "s truly extremely pleasant and Useful post.Thanks ???????
KayGasaway · 3 weeks and 4 days ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up http://mehfeel.net/mehfeel/blogs/post/259660">learn more about this site
jackson2321 · 3 weeks and 4 days ago
I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed... http://www.ukadslist.com/view/item-8885492-SlotXo-Apply-deposit-withdraw-automatic-entrance-play-slots-stable-xo-Slot24th.html">slotxo
KayGasaway · 3 weeks ago
I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! http://www.ukadslist.com/view/item-8885504-Slot-Games-Slot-PG-Joker-XO-Free-Credit-Live-Casino-Football-Betting-MBK1688.html">????????????
KayGasaway · 2 weeks and 6 days ago
Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you. ?????
KayGasaway · 2 weeks and 6 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. ufa ufadna
KayGasaway · 2 weeks and 6 days ago
I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. ufabet
KayGasaway · 2 weeks and 6 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. ??????
KayGasaway · 2 weeks and 6 days ago
Great survey, I'm sure you're getting a great response. ??????
KayGasaway · 2 weeks and 6 days ago
I read that Post and got it fine and informative. ?????????????
KayGasaway · 2 weeks and 6 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. http://www.canetads.com/view/item-3156306-UFA-UFADNA-online-gambling-website-football-betting-casino-UFABET-complete-in-one-website.html">ufa ufadna
jackson2321 · 2 weeks and 2 days ago
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. creating a business plan
KayGasaway · 2 weeks and 1 day ago
A lot of people having an incorrect image about the cash advance loans or sometimes refer it as bad credit payday loans. RARBG
jackson2321 · 2 weeks ago
I needed to thank you for this phenomenal read!! I unquestionably adored each and every piece of it. I have you bookmarked your site to look at the new stuff you post. Amcham Guatemala Juan Pablo Carrasco Degroote
jackson2321 · 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: