Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.
Hide

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:

Hide

News

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

exit without saving history

Terminal - exit without saving history
kill -9 $$
2009-03-27 23:13:53
User: stu
Functions: kill
29
exit without saving history

this exits bash without saving the history. unlike explicitly disabling the history in some way, this works anywhere, and it works if you decide *after* issuing the command you don't want logged, that you don't want it logged

... $$ ( or ${$} ) is the pid of the current bash instance

this also works perfectly in shells that don't have $$ if you do something like

kill -9 `readlink /proc/self`

Alternatives

There are 11 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

Doesn't `readlink /proc/self` return the pid of the readlink program rather than the shell's pid?

Comment by bwoodacre 391 weeks and 1 day ago

heh, yeah, it does. So, time for me to stop assuming everything is a shell builtin :-)

Comment by stu 388 weeks and 1 day ago

I like this better, since a kitten dies every time you kill -9.

unset HISTFILE
Comment by syssyphus 383 weeks and 5 days ago

This is not a good way to do things because you are ignoring anything else that might be done in .bash_logout.

A cleaner way to clear your running history is like this:

OLDHISTSIZE=$HISTSIZE

HISTSIZE=0

HISTSIZE=$OLDHISTSIZE

Also, don't count on being immune from logging by the system as some servers might be running exec loggers, which are independent of the shell.

Comment by deltaray 352 weeks and 6 days ago

[url=http://trungtamketoanhn.com/hoc-ke-toan-thuc-hanh-tai-thu-duc-i864.html]hoc ke toan tai thu duc[/url] ban co [url=http://trungtamketoanhn.com/trung-tam-dao-tao-ke-toan-tai-nguyen-chi-thanh-quan-dong-da-i897.html]hoc ke toan tai dong da[/url] ban co

[url=http://daotaoketoan.top/]đ?o tạo kế to?n[/url] ban co [url=http://trungtamketoanhn.com/khoa-hoc-ke-toan-a12.html]học kế to?n thực tế[/url] ban co

[url=http://daotaoketoan.top/dia-chi-hoc-ke-toan-a2112.html]địa chỉ học kế to?n[/url] ban co [url=http://daotaoketoan.top/cac-khoa-hoc-ke-toan-a2111.html]học kế to?n tổng hợp[/url] ban co

[url=http://hocketoanvn.com/lop-hoc-ke-toan-thuc-hanh-thuc-te-i693.html]lop hoc ke toan[/url] ban co [url=http://hocketoanvn.com/lop-hoc-ke-toan-thue-ngan-han-tren-hoa-don-do-i692.html]học kế to?n thuế[/url] ban co

[url=http://hocketoanvn.com/lop-hoc-ke-toan-tren-excel-thuc-hanh-thuc-te-i690.html]học kế to?n tr?n excel[/url] ban co [url=http://congtyketoanhanoi.net/tin-tuc/khoa-hoc-ke-toan-tong-hop-o-tphcm.htm]học kế to?n tại tphcm[/url] ban co

[url=http://congtyketoanhanoi.net/tin-tuc/trung-tam-dao-tao-ke-toan-tai-hai-duong.htm]trung t?m kế to?n hải dương[/url] ban co [url=http://congtyketoanhanoi.net/tin-tuc/cong-ty-dao-tao-ke-toan-ha-noi-o-hai-phong.htm]kế to?n h? nội tại hải ph?ng[/url] ban co

[url=http://ketoanhanoi.top/trung-tam-dao-tao-ke-toan-cap-toc-tai-hai-phong]hoc ke toan tai hai phong[/url] ban co [url=http://ketoanhanoi.top/khoa-hoc-ke-toan-thue-chuyen-sau]hoc ke toan thue[/url] ban co

[url=http://ketoanhanoi.top/khoa-hoc-ke-toan-tai-thu-duc-tphcm]hoc ke toan tai thu duc[/url] ban co [url=http://dichvuketoanhn.net/trung-tam-dao-tao-ke-toan-tai-quan-3-thu-duc-tan-phu]hoc ke toan tai q3[/url] ban co

[url=http://dichvuketoanhn.net/dich-vu-ke-khai-thue-hang-thang]dich vu ke toan thue[/url] ban co [url=http://dichvuketoanhn.net/trung-tam-dao-tao-ke-toan-tai-quan-3-thu-duc-tan-phu]hoc ke toan tai q3[/url] ban co

[url=http://tinhocvanphong.top/dao-tao-excel-a141.html]dao tao excel van phong[/url] ban co [url=http://tinhocvanphong.top/dao-tao-powerpoint-a142.html]dao tao powerpoint[/url] ban co

[url=http://tinhocvanphong.top/excel-functions-a145.html]ham excel functions[/url] ban co [url=http://vieclamketoan.top/]viec lam ke toan[/url] ban co

[url=http://vieclamketoan.top/tuyen-dung-tai-ha-noi-a2117.html]tuyen dung ke toan tai ha noi[/url] ban co [url=http://vieclamketoan.top/tuyen-dung-tai-tphcm-a2118.html]tuyen dung ke toan tai tphcm[/url] ban co

[url=http://laodongmacau.com/mau-hop-dong-lao-dong-moi-nhat-2016-i1092.html]mau hop dong lao dong[/url] ban co [url=http://laodongmacau.com/mau-bien-ban-doi-chieu-cong-no-2016-i1091.html]bien ban doi chieu cong no[/url] ban co

[url=http://laodongmacau.com/mau-bien-ban-cam-ket-2016-i1094.html]bien ban cam ket[/url] ban co [url=http://hocketoan.top/]học kế to?n[/url] ban co

[url=http://hocketoan.top/dao-tao-ke-toan-a11.html]dao tao ke toan thuc te[/url] ban co [url=http://hocketoan.top/dia-chi-hoc-ke-toan-a14.html]địa chỉ học kế to?n tổng hợp[/url] ban co

[url=http://kthn.edu.vn/khoa-hoc-ke-toan-tong-hop-tai-hai-phong.htm]học kế to?n tại hải ph?ng[/url] ban co [url=http://kthn.edu.vn/hoc-chung-chi-ke-toan-o-dau.htm]hoc chung chi ke toan[/url] ban co

[url=http://kthn.edu.vn/trung-tam-dao-tao-ke-toan-cau-giay.htm]dao tao ke toan o cau giay[/url] ban co [url=http://daotaoketoantphcm.com/]đ?o tạo kế to?n hcm[/url] ban co

[url=http://daotaoketoantphcm.com/hoc-ke-toan-o-dau-tot-nhat-tphcm-i689.html]học kế to?n ở đ?u tphcm[/url] ban co [url=http://daotaoketoantphcm.com/dich-vu-ke-khai-thue-tai-tphcm-i696.html]dich vu ke khai thue tphcm[/url] ban co

[url=http://trungtamketoanbacninh.com/khoa-hoc-ke-toan-tong-hop-tai-bac-ninh-i689.html]học kế to?n tại bắc ninh[/url] ban co [url=http://trungtamketoanbacninh.com/hoc-ke-toan-o-dau-tot-nhat-bac-ninh-i690.html]hoc ke toan o dau bac ninh[/url] ban co

[url=http://trungtamketoanbacninh.com/dich-vu-ke-khai-thue-hang-thang-i697.html]ke khai thue tai bac ninh[/url] ban co [url=http://ketoanhanoihn.com/]dich vu ke toan ha noi[/url] ban co

[url=http://ketoanhanoihn.com/dia-chi-hoc-ke-toan-tai-cau-giay/]lớp học kế to?n tại cầu giấy[/url] ban co [url=http://ketoanhanoihn.com/trung-tam-day-hoc-ke-toan-tong-hop-tai-quang-ninh/]lớp học kế to?n tại quảng ninh[/url] ban co

[url=http://diachiketoan.com/]địa chỉ học kế to?n tốt nhất h? nội[/url] ban co [url=http://diachiketoan.com/hoc-ke-toan-thuc-hanh-o-long-bien/]Học kế to?n thực h?nh ở Long Bi?n[/url] ban co

[url=http://diachiketoan.com/khoa-hoc-ke-toan-xay-lap-xay-dung/]học kế to?n x?y lắp[/url] ban co [url=http://ketoanhn.edu.vn/]ke toan ha noi[/url] ban co

[url=http://ketoanhn.edu.vn/trung-tam-day-hoc-ke-toan-tai-minh-khai-hai-ba-trung.html]học kế to?n tại Minh Khai[/url] ban co [url=http://ketoanhn.edu.vn/trung-tam-dao-tao-ke-toan-thuc-hanh-tai-quan-thanh-xuan.html]đ?o tạo kế to?n thực h?nh tại thanh xu?n[/url] ban co

[url=http://trungtamketoanhanoi.edu.vn/hoc-ke-toan-o-dau-tot-nhat-ha-noi-hien-nay.html]học kế to?n ở đ?u tốt nhất[/url] ban co [url=http://trungtamketoanhanoi.edu.vn/trung-tam-dao-tao-ke-toan-tong-hop-tai-ha-dong.html]trung t?m kế to?n h? đ?ng[/url] ban co

[url=http://trungtamketoanhanoi.edu.vn/trung-tam-dao-tao-ke-toan-thuc-hanh-o-long-bien.html]trung t?m kế to?n long bi?n[/url] ban co [url=http://ketoanbienhoa.org/]học kế to?n cấp tốc tại bi?n h?a[/url] ban co

[url=http://ketoanbienhoa.org/hoc-ke-toan-o-dau-tot-nhat-bien-hoa-dong-nai-i426.html]hoc ke toan o dau bien hoa[/url] ban co [url=http://ketoanbienhoa.org/dao-tao-ke-toan-a112.html]trung tam ke toan dong nai[/url] ban co

[url=http://ketoanhaiduong.net/]học kế to?n tổng hợp tại hải dương[/url] ban co [url=http://ketoanhaiduong.net/dia-chi-hoc-ke-toan-tai-hai-duong-i434.html]dia chi hoc ke toan o hai duong[/url] ban co

[url=http://ketoanhaiduong.net/dao-tao-ke-toan-a112.html]đ?o tạo kế to?n hải dương[/url] ban co [url=http://ketoanvinhphuc.net/]hoc ke toan o vinh phuc[/url] ban co

[url=http://ketoanvinhphuc.net/dao-tao-ke-toan-a112.html]trung tam ke toan vinh phuc[/url] ban co [url=http://ketoanvinhphuc.net/tuyen-dung-ke-toan-tai-vinh-phuc-a291.html]tuyen dung ke toan tai vinh phuc[/url] ban co

[url=http://trungtamketoanhaiphong.com/]học kế to?n tổng hợp tại hải ph?ng[/url] ban co [url=http://trungtamketoanhaiphong.com/lop-hoc-ke-toan-thuc-te-tai-hai-phong-i430.html]lop hoc ke toan tai hai phong[/url] ban co

[url=http://trungtamketoanhaiphong.com/tuyen-dung-ke-toan-tai-hai-phong-a288.html]tuyen dung ke toan tai hai phong[/url] ban co [url=http://dichvuketoan.top/]dich vu ke toan gia re[/url] ban co

[url=http://dichvuketoan.top/bang-gia-dich-vu-ke-toan-a145.html]bang gia dich vu ke toan[/url] ban co [url=http://dichvuketoan.top/dich-vu-ke-toan-thue-tron-goi-tai-hai-duong-i888.html]Dịch vụ kế to?n tại Hải Dương[/url] ban co

[url=http://dichvuketoangiare.org/]Dịch vụ kế to?n trọn g?i[/url] ban co [url=http://dichvuketoangiare.org/i452-dich-vu-lam-bao-cao-tai-chinh-hang-thang.html]dich vu lam bctc[/url] ban co

[url=http://dichvuketoangiare.org/i454-dich-vu-don-dep-so-sach-ke-toan-hoan-thien-so-sach.html]dịch vụ dọn dẹp sổ s?ch[/url] ban co [url=http://lamdichvuketoan.com/]b?o c?o t?i ch?nh cuối năm[/url] ban co

[url=http://lamdichvuketoan.com/dich-vu-ke-khai-thue-hang-thang/]dich vu ke khai thue[/url] ban co [url=http://lamdichvuketoan.com/dich-vu-lam-ke-toan-noi-bo/]dich vu lam ke toan noi bo[/url] ban co

Comment by danchoi123 11 weeks and 2 days ago

Your point of view

You must be signed in to comment.