10 great and powerful Linux commands you may want to know | Unixmen
Command line is more powerful because you can do lot with them, you can tell your computer exactly what you want and get the appropriate answer.
That is why most of us use the terminal at least once a day. Today we will see another List of useful commands, i`m sure that most of you didn`t hear about them before. Lets see .
1- Run the last command as Root
sudo !!2- Save a file you edited in vim/vi without the needed permissions
:w !sudo tee %If you opened a file for edit and when saving you noticed that you forgot to open file as root, the command above is the solution.
3- Runs previous command but replacing : ”foo” by “bar”
^foo^barIf you did run a long command and you noticed that you made a mistake, to correct the command you can replace only the mistake by the correct word without the need to run the whole command again.
Another alternative to the above command is:
!!:gs/foo/barAs opposed to ^foo^bar, which only replaces the first occurrence of foo, this one changes every occurrence
4- Short and elegant way to copy or backup a single file before you edit it.
cp filename{,.bak}5- mtr, better than traceroute and has ping combined
mtr unixmen.commtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.
6- Empty a file without removing it
> file.txt7- Execute command without saving it in the history
<space>command8- Clear a terminal screen
ctrl-l9- List of commands you use most often
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head10- Get your external IP address.
curl ifconfig.meThis is all for today, enjoy
Linus Torvalds: The King of Geeks (And Dad of 3) | Wired Enterprise
The license plate on Linus Torvalds’ Mercedes SLK convertible says it all. The frame running around the outside of the plate reads “Mr. Linux. King of Geeks.” But the plate itself says “Dad of 3.”
If you meet Linus Torvalds, he comes off as a mild-mannered, down-to-earth Finnish-American. He lives with his wife Tove, three kids, a cat, a dog, a snake, a goldfish, a bunny and a pet rat in a comfortable 6,000 square foot home just north of Portland’s tony Lake Oswego neighborhood. The house is yellow — his favorite color — and so’s the Mercedes.
But he’s not really like any of his neighbors. He drives his Mercedes fast, slamming the car into gear and flooring it. There’s no coaxing, no hesitation. Either the hammer is down, or the car is at rest. And he has an abnormal number of stuffed penguins on his mantle.
He leads a double-life. He’s the kind of guy who plays poker with the guys for a $20 buy-in every couple of weeks. But at the same time, he in charge of Linux, a truly remarkable open-source software development project that over the past two decades has shaken Microsoft and provided the building blocks for internet giants such as Google, Facebook and Amazon.
Linus Torvalds has reached middle age, and so has Linux. Nowadays, it’s easy to take both of them for granted. But both are still going strong — very strong. Linus still runs the Linux kernel with his unique brand of no-nonsense attitude. Two weeks ago, he called the makers of SUSE Linux morons because of the operating system’s security requirements. And Linux? It’s everywhere. Next week, Red Hat will become the first $1 billion open source company.
Linux began life as an underdog project. Torvalds started it while he was a student at the University of Helsinki because he wanted to improve Unix on his Intel 386 computer. But it soon became an antidote not only to the massive Unix servers built by the likes of Digital Equipment Corp and Sun Microsystems, but to Microsoft’s Windows operating system.
Throughout the ’90s and on into the next decade, the fight was fierce on both fronts, but now, so many of the battles are won. DEC and Sun don’t exist anymore. And Microsoft is playing quite nicely with Linux and other open source tools. Linux isn’t the hot-button topic it was once was. It’s just plain successful.
More than 8,000 developers have contributed to the Linux kernel in the past seven years, according to the Linux Foundation. And it has even become a standard operating system on custom-built consumer devices. You can find it on everything from inflight entertainment systems to streaming video players to Google’s Android phones. “It became the plumbing,” says Jeremy Allison, a Google engineer who speaks frequently on the topic of open source and is himself a lead developer with another coding project, called Samba.
And Linus became a dad. But what a dad he is.
Linus Torvalds Meets Robert Downey, Jr.
Red Hat can thank Linus for reaching $1 billion in annual revenue. And Linus can thank Red Hat for his yellow house in Portland. Prior to its initial public offering in 1999, Red Hat gave Torvalds what turned out to be about $1 million in stock. But Torvalds says that it was his only big Linux payout. Stock that he was awarded from Transmeta and another Linux startup, VA Systems, wasn’t worth very much by the time he was allowed to sell it.
Still, Torvalds’ life is pretty darned good by geek standards. He gets paid by the non-profit Linux Foundation to manage the open source software that he loves and — when he wants to — can fly around the world to talk about it. He has the freedom to pursue his other passion: diving. Last week, Torvalds and his friend Dirk Hohndel spent a few days in the 40 degree waters of the Hood Canal, helping to dive-certify six native American geoduck hunters, and Torvalds has even started writing open-source dive-log software.
Last year, Intel invited Torvalds and Tove to a pre-Oscar party in Hollywood, where he rubbed elbows with the likes of Robert Downey Jr., who didn’t know who he was, and Mad Men star Jon Hamm, who did.
Does he have any regrets? “Not at all,” he says. “Quite the opposite, actually. I’m very happy with feeling that I’ve done the right thing.” He adds: “I mean, if I’d started a company, that wouldn’t have been because I wanted to start a company. I concentrated on the technical side because that’s what I wanted to do.”
And that’s good news for just about every big internet company, along with the startups that aspire to displace them, because they love to use Linux.
The Linux Storm
Linux worked because three powerful forces just happened to converge. First, Linux started just as Intel’s processors were getting ready for prime time. Long before company employees were sneaking iPads and smartphones into the office, there were Linux freaks sneaking Intel machines into corporations to build prototype new programs and build cheap websites and file and print servers.
The second force was the GNU General Public License. In the 1980s, the Unix makers had done well, but they’d kept a lot of their best technology to themselves. This had been good for business, but in the long run it was bad for Unix. By 1991, there were many incompatible versions of Unix. But Linux’s license dictated that anybody who made changes had to share them. That’s kept the project from splitting apart, and it ensured that any really good software gets used by everybody.
But the third factor was Torvalds himself, who has put his personal stamp on the Linux in a way that is rare in the open-source world.
When Linus Torvalds moved to the U.S. in the late 1990s, the Linux hype was at its peak. And Linux’s creator was a particularly effective spokesman for the open-source revolution. He worked for an interestingly secretive chip startup called Transmeta — it fizzled out in the post-dot com implosion — but as long as reporters didn’t ask about Transmeta itself, Torvalds was the kind of guy who would speak his mind, apparently unconcerned with who he might happen to piss off.
Torvalds became the perfect foil to the monopolistic, unlikable, Bill Gates. He was low key, unassuming, a regular guy who was into computers just for fun. That was the name of his surprisingly readable autobiography, written in 2002 with journalist David Diamond — a book that Torvalds says he never thinks about today.
Torvalds is still doing things just for fun. He’s a free operator who pulls no punches in technical online discussions, but he’s not a blowhard. It’s enough to give him geek credibility, but to keep him from alienating the smart people. The makers of SUSE Linux know what we’re talking about.
The Job Offer From Steve Jobs
That passion to make the right design choice is still what drives Torvalds, even as Linux enters its comfortable middle age. “Linus, the person, certainly like all of us, he’s gotten older,” says Dirk Hohndel, the diving-buddy of Torvalds’ who also happens to be chief Linux and open-source technologist at Intel. “But Linus, the god of Linux, has not changed at all. He is still the same fiery aggressive, flaming wild, determined true-believer — the person who really knows exactly what he wants.”
Torvalds may have been a foil to Gates, but Linux’s creator probably has more in common with Steve Jobs. Torvalds leads the Linux project, not so much by writing code, but by arbitrating disputes and making the technical decisions that keep the project moving in the right direction. And that’s ability is similar to Jobs’ fanatical attention to design detail, says Google’s Allison.
“Jobs had this wonderful design sense of taste. He created these beautiful products that everybody loved,” he says. “Linus has engineering taste, and that’s the thing that kind of makes him special. He can look at all these potentially competing solutions and cut through the bullshit and say, no this is the right one to choose.”
“He’s good at that,” Allison adds. “It means he’s a dick sometimes, but he’s good at it.”
Torvalds has never met Bill Gates, but around 2000, when he was still working at Transmeta, he met Steve Jobs. Jobs invited him to Apple’s Cupertino campus and tried to hire him. “Unix for the biggest user base: that was the pitch,” says Torvalds. The condition: He’d have to drop Linux development. “He wanted me to work at Apple doing non-Linux things,” he said. That was a non-starter for Torvalds. Besides, he hated Mac OS’s Mach kernel.
“I said no,” Torvalds remembers.
Jobs He’s Not
But the Jobs-Torvalds analogy breaks down pretty quickly. Jobs was fabulously wealthy, dated celebrities, and didn’t write cute things about his kids on his license plate. In fact, he didn’t even use license plates. And when he had a software problem at Apple, he didn’t sit down and write an amazing new program that solved the issue. Torvalds has done that kind of thing.
On the day Wired visited Torvalds last month, his slightly obsessive attention to detail was on full display. Torvalds quickly invited us in and immediately starting making espresso after espresso in his modern kitchen. His employer, the Linux Foundation, had just bought him a brand new $3,000 Jura espresso maker, and he and his wife Tove were concerned that something is wrong.
Tove had been complaining about a metallic aftertaste, and Torvalds thought it may be a problem too. He handed over an espresso, asking: “Do you taste it?”
To us, the bitter, creamy espresso tasted like it came from a fine coffee shop.
Torvalds kept making coffees all morning, leaving us jittery and awake as we settled down to talk in the billiard room next to the modest unadorned home office that is the nerve center for Linux. It’s above the three-car garage. The kind of place where your typical suburban dad would keep his guitar collection and rock out with his buddies over a couple of beers on a Thursday night. Instead, Torvalds spends most days here — alone — managing what is surely the most important open-source software project in the planet.
As Torvalds himself concedes, Linux’s stormy days of fighting over big issues are largely behind it. “I am personally way less open to radical new redesigns,” he says. “We’ve done the radical redesigns to the point where most of the things we do, we do for damned good reason, and doing something radically different would be just stupid.”
Linux hosts an annual event called the Linux Kernel Summit, and to hear Torvalds describe it, it sounds almost like a synod of medieval theologians. “We had the most boring two-hour session on key-signing each others keys,” he remembers. “Boy that was not fun.”
In fact, Linux’s creator doesn’t really even like to talk about technology. He’d rather write. “I think it’s so much easier to be very precise in what you write and give code examples and stuff like that,” he says. “I actually think it’s very annoying to talk technology face-to-face. You can’t write down the code.”
He’d rather talk about politics. Or scuba diving. Or the state of the public school system. Or the taste of coffee.
What if Ubuntu were right? - Where is Ploum?
Last week, I had the chance to have a nice chat with Jonathan Riddell, Canonical employee and Kubuntu maintainer.
For years, Jonathan was paid to maintain Kubuntu. In a recent move, Canonical announced that Kubuntu will become a community-only project. As a way to start the conversation, I poked him about that:
— What happened? Is Canonical dropping KDE support?
— Well, we are doing with KDE exactly what we did with GNOME.
— Indeed. But what is the reason?
— Canonical seems to think that none of them managed to reach a non-geek audience.And, sadly, I had to agree with that.
What is a desktop environment?
Since I’m involved in GNOME, I don’t remember being able to explain what the GNOME project was to any non-geek. Ubuntu is something people understand. Linux is an harder concept but still manageable: it’s the heart of the system, something invisible and magic that handle everything. But a desktop? People just cannot tell the difference between a desktop environment and an operating system. And, when you think about it, the whole definition is somewhat arbitrary.
Who cares about the desktop environment?
In fact, the only people I know who really care about what is GNOME are… GNOME developers and fans. What might illustrate this better is the astonishing lack of reaction which followed Ubuntu’s move to Unity.
Yeah, sure, bloggers have discussed merits of Unity vs GNOME 2 vs GNOME 3. There was some buzz about Linux Mint. But, outside the geek microcosm, what have we seen? Nobody really cares. Ask any casual Ubuntu user: most didn’t even noticed it was a big change. Some say it’s better, some prefer the old way but don’t make it a big deal. In fact, most of the blog posts even agree on this: Unity and GNOME 3 are, well, different. No winner.
People want an application launcher, that’s all.
Shifting out of the desktop paradigm.
The world is increasingly shifting away from the standard desktop: iOS, Android, Metro. There’s currently a quest going on to make the computing experience very similar on small devices or on bigger television, including tablets, netbooks, laptops, desktops.
That experience will be the main selling point of OS vendors and it only makes sense for an OS vendor to reclaim control about its own destiny without depending on any external project. Which is exactly what Ubuntu did.
What should a desktop environment be?
When KDE and GNOME appeared, Linux was mostly seen as technical environment. Developing a desktop was logical and highly needed. Lof of what we take for granted today should be credited to those who pioneered KDE and GNOME.
But we reached the point where there’s no clear separation anymore between what is part of the OS and what is part of the desktop. Should the configuration tools be part of the desktop or the OS? Even the package management is now offered as an OS independent layer in the desktop.
This explains why I’ve never successfully explained what GNOME was: what it is and what it has to offer is arbitrary and not clear.
In fact, I see two possible futures for the GNOME project:
1) Being a software catalog. Offering software which have similar design goals and let the OS pick what they want. Sometimes, multiple alternatives for the same need can be offered. This makes the shell mostly irrelevant or anecdotal in the whole GNOME project and it is exactly the way Ubuntu uses GNOME.
2) Offering a complete operating system and controlling everything from the kernel level. This idea is sometimes referred as GNOME OS.
As we said in French, we currently have our ass between two chairs, not really able to take a decision, which is the worst situation.
And what about Unity?
The main criticism about Unity is that it is “yet another desktop”, fragmenting the community. But, in fact, Unity is a pure Canonical project like Android is a pure Google project. There’s no involvement from the community. Canonical wants to be able to control the appearance of its core product and who will blame them for that?
To their credits, it can be added that they tried to play it fair first with the “netbook remix edition”, which failed to gain any attention from upstream.
And is GNOME really better? GNOME-shell design decisions are taken by a handful of designers, most of them employed by Red Hat, which has no interest in smartphone/television. Has the wide community anything to say in the design process? Not much. And that’s a good thing if you want to avoid the bicycle-shed/UserLinux syndrom.
So, all technical qualities set apart, what is our problem with Ubuntu?
Maybe, what we hate with Unity is that it proved us that we were a small circle of geeks, that most users don’t care and didn’t even noticed that they were switching their desktop. The desktop war looks like the window managers war of ten years ago: all the geeks tried to find the best one while, in the end, it appeared that what user wanted was just to move windows. And none really won. WM, those day, are just anecdotal projects that only geeks care about.
The future?
Unity seems to have quite a clear future: it will stay and evolve as the Ubuntu default interface, from Ubuntu TV to any Ubuntu device, offering quite a consistent experience while you stay in the Ubuntu world.
But what is the future of GNOME and KDE? How do you see it? What will they offer? Do you think it’s a good idea to leave Ubuntu in order to keep GNOME at all costs? Should GNOME work on GNOME-OS?
What if, all irrational feelings set apart, we realized that Unity was the right move?
Picture by Carsten Knoch
The Greatness of Git
When Linus Torvalds says he is going to work on a side project he doesn’t think small and he doesn’t work slowly.
When he created “Git,” the software source control and collaboration system that runs Linux kernel development, he started writing code on a Sunday (April 3, 2005) and emerged just a few days later with a new revision control system that today is regarded as one of the best pieces of software ever written (second, at least, to Linux, of course).
Andrew Morton said when introducing Linus to speak about Git to an audience at Google, Git is “expressly designed to make you feel less intelligent than you thought you were.”
Software Freedom Law Center Founder and co-author of the GPL Eben Moglen said during a keynote panel at LinuxCon last August: “Linus was presented with a nasty weekend once upon a time and out of it came Git. Another brilliant achievement, you understand. A work of superb design that is going to change the software industry and the world…because one man had one itch one weekend that was really biting, and he had to invent something. And he’s a brilliantly inventive man and scored another hole in one.”
Git had to be great in order to support the unmatched rate of development that Linux requires. Today, the Linux community applies more than five patches per hour to the kernel and to date has written more than 15 million lines of code. The sheer size of Linux development has made the project one from which others have borrowed both collaborative development lessons and and tools - like Git. Today Git is used by the Linux community, as well as developers working on projects that range from Ruby on Rails to Android to Perl and Eclipse, and many more.
The popularity of Git is also resulting in it becoming part of the technology vernacular, with businesses based on Git flourishing.
Consider GitHub. This is an amazing code repository that uses the Git revision control system and has become one of the most popular places to host and collaborate on software. This service is being used by more than a million people to store over two million code repositories.
Could Git also be getting into publishing? Maybe. Wired.com reporter Bob McMillan recently took GitHub for spin, publishing his story about the repository in the repository.
“GitHub was originally designed for software developers…But nowadays, it’s also being used to oversee stuff outside the programming world, including DNA data and Senate bills that may turn into laws and all sorts of other stuff you can put into a text file, such as, well, a Wired article.”
He might have gotten a little more than he bargained for with all the collaboration, but his experiment demonstrates its power.
GitHire is another new online application and service that builds upon Git for finding the world’s best programmers. GitHire will crawl git repositories, find and rank programmers based on their code and reputation and provide employers with a short list of the world’s best talent most relevant to their needs. If you’re a software developer and doubted it before, code is most definitely the new resume.
There are a number of other examples, as well as native Git for Windows, Git implementations in other languages, tutorial businesses based on Git, and more.
The measure of truly great software development is use. When others use it and build new projects and/or businesses from it, you know it’s truly great. This is the essence of Linux and open source software development. By writing the best code and sharing it with the world, everything gets better, faster, and there becomes even more new ways to collaborate and share.
Linus Torvalds’s Lessons on Software Development M… - Input Output
If anyone knows the joys and sorrows of managing software development projects, it would be Linus Torvalds, creator of the world’s most popular open-source software program: the Linux operating system. For more than 20 years, Torvalds has been directing thousands of developers to improve the open source OS. He and I sat down to talk about effective techniques in running large-scale distributed programming teams – and the things that don’t work, too.
Torvalds says there are two things that people very commonly get completely wrong, both at an individual developer level and at companies.
“The first thing is thinking that you can throw things out there and ask people to help,” when it comes to open-source software development, he says. “That’s not how it works. You make it public, and then you assume that you’ll have to do all the work, and ask people to come up with suggestions of what you should do, not what they should do. Maybe they’ll start helping eventually, but you should start off with the assumption that you’re going to be the one maintaining it and ready to do all the work.”
Torvalds continues, “If you start off with some ‘kumba-ya feeling’ where you think people from all the world are going to come together to make a better world by working together on your project, you probably won’t be going very far.”
“The other thing—and it’s kind of related—that people seem to get wrong is to think that the code they write is what matters,” says Torvalds. Most software development managers have seen this one. “No, even if you wrote 100% of the code, and even if you are the best programmer in the world and will never need any help with the project at all, the thing that really matters is the users of the code. The code itself is unimportant; the project is only as useful as people actually find it.”
I’ll add at this point that this isn’t just a programmer problem. I’ve seen entire companies get locked into the idea that “perfecting” the program was everything. They then neglected what the users wanted from the program, supporting the users and so on. Most of us who’ve been in the business for a while have seen this cycle play out over and over again.
Expanding on that second point, Torvalds says that’s why the Linux kernel team is “so very anal about the whole ‘no regressions’ thing, for example. Breaking the user experience in order to ‘fix’ something is a totally broken concept; you cannot do it. If you break the user experience, you may feel that you have ‘fixed’ something in the code, but if you fixed it by breaking the user, you just violated that second point; you thought the code was more important than the user. Which is not true.”
Torvalds concludes, “Way too many projects seem to think that the code is more important than the user, and they break things left and right, and they don’t apologize for it, because they feel that they are ‘fixing’ the code and doing the right thing.”
To that I can only add “Amen!”
On the Importance of Development Tools
I also asked Torvalds about Software Configuration Management (SCM) tools like his own Git version control system. He replied, “I don’t think tools are all that fundamentally important.”
“Now, what is important is that there’s a good workflow for the project, and tools can certainly help with that,” said Torvalds. “But most projects don’t necessarily really need tools. There’s a lot of projects that simply don’t have enough changes to really require any tools at all for their work flow; if you only have a few hundred patches per release, you can maintain those just about any way you want, including entirely by hand.”
Linux is a different story of course. “For the kernel, we have thousands of patches flying around every release, and a release roughly every three months, and so for us the tools really are very important,” he says. “But I still don’t think it was all that big a mistake to just do tar-balls and patches for the first few years of development; it was a much smaller project back then, and it took several years for the lack of tools to really become a problem.”
Besides, “Some tools encourage workflows that are actively detrimental, and I think CVS [Concurrent Versions System, a version control system] for example has caused a lot of projects to have the notion of a ‘commit cabal,’” Torvalds continues. “I personally tend to think tar-balls and patches are actually preferable to that – if only because they make all developers ‘equal,’ and you don’t get the kind of model where certain people have ‘commit access,’ and the rest are second-class citizens. Sometimes it’s better that everybody is a second class citizen than that some people have an easier time at it.”
Torvalds, I should note, knows CVS well and has hated it for years. As he said in a Google Talk in 2007, “I hate CVS with a passion.”Torvalds continues, “Much more important than the tools is the people. The maintainers, and the mindset.”
Keeping People On Track
And how do these people work together today? I asked Torvalds about the role of the Linux Kernel Mailing List (LKML) in the process. He replied, “I think Linux used to ‘happen’ more on LKML than it does these days. The signal-to-noise ratio and just the pure volume of LKML means that most developers simply don’t have time to really read LKML—at best they scan subject lines. As a result, these days I’d argue that most of the real development happens within the sandbox of single developers, and then email on more of a person-to-person scale is actually how things really get done.”
That said, “That doesn’t mean that LKML isn’t important; it means that LKML has become the ‘public band’ of all those individual email threads,” Torvalds adds. “So what ends up happening is that you have maybe four or five people involved in a discussion about their work, but LKML stays cc’d on the whole thing. That turns what would otherwise be a purely private discussion into something where others can jump in.”
Here’s how it works, “A lot of people actually don’t really ‘read LKML;’ they often auto-archive it, but then react to certain keywords or, more often, [to] key people being involved in the discussion.”
“It also acts as a kind of archiving notion,” Torvalds continues, “so that people can refer to it later, and a lot of bug reports end up being found by Googling for them. If somebody raises an issue, it may well be some odd hardware problem, but if Google shows that it’s been raised several times on LKML in the past, that starts to indicate that it may be obscure, but it’s certainly not some totally isolated issue.”
“So I think LKML is really quite important, but no, it’s not how we keep people ‘on track,’” he says. “All the developers tend to be pretty self-motivating, and they all have sane ideas (well, the core ones do by definition – because that’s how they became core developers, by showing that they had good taste and high motivation). It’s important simply because that ‘public part’ of the discussions are still important, even if in practice it’s often a pretty small core in any particular discussion. Things are simply different when they happen in the open,” concludes Torvalds.
On Delegating – and Staying Sane
Once, Linux was a solo project. It now has thousands of committers and contributors. I then asked, “How much delegating do you these days? Any thoughts on how to delegate to keep one’s sanity and the workflow flowing?”
“If there’s one thing I’ve learnt, it is that you have to learn to let go and not try to control people and the code,” he says. “If you don’t think somebody else can do it on their own without your oversight, you might as well give up immediately as a maintainer.”
He continues, “Yes, I often get involved in small details, but it’s not because I don’t trust people or don’t delegate. It’s because some small detail ends up being brought up to me. Either it’s a bug (and they are almost all just silly small details that got overlooked), or it’s just some workflow issue that bothers me (like me complaining about the developer names not showing up properly in the logs earlier today to one sub-maintainer).”
Still, says Torvalds, “Those details have to be occasional details, not the kind of ‘look over the shoulder of the developer to check everything he does.’ I trust sub-maintainers to do the right thing 99% of the time. And then, very occasionally, I end up complaining loudly about something.” Say, for example, on how the open-source GNOME desktop is, or rather isn’t, moving forward.
So, there you have it. That’s some of the ways Torvalds does it. And, if you think you know better, ask yourself: Have I created a world-class operating system that runs most supercomputers, stock-exchanges, and websites like Google? If your answer’s no, I’d re-read his answers and take a long hard think about how you’ve been managing your own projects.






