Following in the footsteps of legendary investors such as Warren Buffett, George Soros, and Carl Icahn may make sense, given that these three have proved themselves in both good and bad times. Fortunately for us, all three of them file a document known as a 13F with the SEC every quarter showing what they bought and sold in the most recent quarter.

Previously, I highlighted stocks that these billionaires are buying, but now it's time to look at the companies they're giving up on.

Warren Buffett
Buffett is best known for his patience, but every so often the Oracle of Omaha will buy shares in a company that doesn't live up to its promise, and when that happens, Buffett's patience thins quickly.

One of the most notable examples is Buffett's about-face on U.K. food giant Tesco, one of Europe's biggest grocers. When Tesco management took heat over accounting mismanagement, Buffett packed his bags and went looking elsewhere for value.

Given Buffett's willingness in the past to approach investments objectively, it's probably not surprising that his latest sales are of energy companies that are wilting under the weight of crumbling oil prices. In the second quarter, Buffett continued to unwind his energy stakes by selling his remaining shares in oil and gas equipment maker National Oilwell Varco (NOV 1.35%) and oil refiner and retailer Phillips 66 (PSX 0.91%).

Buffett's unwillingness to keep owning these companies may indicate that he doesn't think crude prices will return to their lofty peak anytime soon. If he's correct, then investors will want to continue avoiding attempts to catch the falling knives that have become common throughout the oil patch lately.

George Soros
Perhaps no one is better at navigating market pops and drops than Soros, a legendary hedge fund manager who has made billions relying on a revolving-door approach to portfolio management.

Soros' in-and-out style means that his portfolio could as easily buy the same stock next quarter that he sold this quarter, but that doesn't mean investors should ignore his activity. After all, few managers can match up to his long-term 30% annualized returns while at the helm of the fabled Quantum fund.

In the second quarter, clinical-stage biotech companies Kite Pharmaceuticals (NASDAQ: KITE) and Juno Therapeutics (JUNO) were among the most intriguing stocks Soros sold.

Previously, Soros' appetite for next-generation immuno-oncology drug developers was big, as seen in his participation in the IPOs of both Kite and Juno, both of which are working on re-engineering the immune system to better find and destroy cancer cells.

Now that Soros is walking away from Kite and Juno, it may signal that he believes the valuation being awarded to these companies has gotten a little rich. Given that Kite and Juno still boast multibillion-dollar market caps even though their most advanced drugs are still in phase 1 trials -- the earliest stage of human studies -- it's not an unreasonable assumption.

Should you follow in Soros' footsteps and sell Kite and Juno, too? It depends on your appetite for risk. Both have already fallen significantly from their peak earlier this year, and if their approach is validated in future trials, picking up shares at this price will seem like a bargain. However, there's a lot that can still go wrong from here, too, especially since 90% of drugs entering phase 1 never make it to market. For that reason, these two remain suitable only for the most risk-tolerant of us.

Carl Icahn
Icahn is perhaps the best known activist investor in America, and his penchant for taking stakes in companies and then agitating for shareholder-friendly change has made him billions of dollars.

Icahn's recent success includes persuading eBay to spin off PayPal, but it appears he's less optimistic that he can unlock similar value at Netflix (NFLX -9.09%) -- the only company Icahn unloaded last quarter.

Icahn acquired his 10% stake in Netflix in 2012 and then sold half of his stake in 2013 for a 457% gain. In the second quarter, he exited the remainder of his position, bringing his total profit in Netflix to a reported $1.9 billion.

At the time of his sale, Icahn tweeted that he believes Apple Inc..offers investors an opportunity reminiscent of Netflix at the time of his purchase. If so, then it could prove to be the better buy from here than Netflix.

Tying it together
A long-term investing approach has been proved to outperform short-term trading time and time again; however, identifying stocks to own for the long haul can be hard. Sometimes, trends change, and investors need to change with them or risk riding the next Radio Shack and Eastman Kodak to bankruptcy.

Although the stocks these gurus sold last quarter aren't likely to end up in the wastebasket like those two, Buffett, Soros, and Icahn's decisions to sell suggest it's time to revisit the reasons for being long shares, to make sure nothing has changed that would require selling them, too.