Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What are the most important linux commands to know for development?

I currently have the following down ok: cp, rm, mkdir, pwd, ls, scp, ssh, cat, mv, tar, and gzip. What else are commonly used? I'm not looking to memorize all the commands, but just be comfortable with the most-used commands, and look up the ones I don't know when it comes to that.

Also, from Python what is the (pipe) command to copy, move, rm or mkdir?

share|improve this question

migrated from stackoverflow.com Apr 14 '11 at 6:28

This question came from our site for professional and enthusiast programmers.

closed as not constructive by Lèse majesté, Su', John Conde Jan 25 '12 at 20:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

"Be comfortable with the furniture you have at home right now, not with what you will require in your lifetime." – N 1.1 Apr 14 '11 at 6:07
None of those commands are important for web development. They're important for using the OS but totally non-specific to web development, C development or even development in general. – paxdiablo Apr 14 '11 at 6:11
I'd argue that knowing how to run an ssh session is actually quite relevant to web development. If the best you can do is FTP files, you're severely crippled. – Paul McMillan Apr 14 '11 at 6:20
@Paul: Many web developers will never need to touch ssh--for instance developers on MS platforms. Also, it's important to distinguish development from system administration. If your job is purely web development, then you aren't "crippled" just because you don't know how to use the unix command line. – Lèse majesté Jan 25 '12 at 17:03

Well, you've left out the really obviously useful grep. If you don't know grep, you're really crippled. You'll also need to understand how pipes work, and how redirects work. Also, you should have a good understanding of ps, kill, and (if you're working on a vps) free. Also the difference between stderr and stdout.

In Python, those commands are generally in the os library.


share|improve this answer
ack is much more useful than grep if you want to use it to search through your sourcecode files – ThiefMaster Apr 14 '11 at 6:15
ack isn't installed by default everywhere like grep is. – Paul McMillan Apr 14 '11 at 6:17
On a development systems that's not really a problem – ThiefMaster Apr 14 '11 at 6:18

I wouldn't want to miss ack. It's basically a recursive grep but designed for searching sourcecode so you can e.g. use --python to search only python files etc.

share|improve this answer

Learn to use a good source control package (I recommend git) to keep track of your changes.

Source control can be useful for tracking both source files and configuration files.

share|improve this answer

What you need to know is very dependent on what you're developing and the environment you're developing it in. Pick your project then learn the tools needed to complete that project. In using those tools you'll easily memorize the core commands and can use a cheatsheet for the rest.

share|improve this answer

This is by far an incomplete list, cause ultimately the full list will include what's in core-utils and many other packages. But the list you have, can easily be sumplemented with whats in available in /bin

So ls /bin and ls /usr/bin (/usr/bin will be a long listing, so pipe it into less). and start looking, reading and marking down. /sbin and /usr/sbin have commands that might be useful, but these are more for root than a regular user. There is never going to be a definitive list of commands to know "for development", because ultimately, each and every command has its place and usage, "for development" being way to ambiguous.

Also get a good unix book and read through that, that will take you through the more common commands also.

The os library and the shutil library are the best place to find these tools... in python. shutil having copy, copy2 and rmtree (The most used ones by me).

share|improve this answer

Here's a random list of useful linux commands in no particular order:

  • grep (or ack-grep)
  • find
  • xargs
  • chown/chmod (-R to recur down a directory tree)
  • rsync
  • tail -f, less (F to follow a file)
  • wget, curl
  • apache benchmarking: ab
  • performance / process monitoring: ps, dstat, uptime, top, iftop, iptraf, iostat
  • learn shell scripting

Another command I often use (aliased) to check memory usage is

ps -eo rss,pid,comm,args | sort -n 

I'm not sure what you mean exactly by piping, but subprocess.call allows you to pipe shell commands into each other. I'd also recommend fabric for deploying python projects.

share|improve this answer

I would like to add sed and awk to the list :]

share|improve this answer

Maybe this cheat sheet could come in handy here.

share|improve this answer

Look especially to basic system administration. You must know how to write an init script and how to manage users in Distro. Spend also some time to learn how to change permission (chmod) and the owner (chown) of a file.

share|improve this answer