-1

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?

4
  • 1
    "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, 2011 at 6:07
  • 4
    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, 2011 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. Apr 14, 2011 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. Jan 25, 2012 at 17:03

9 Answers 9

2

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.

http://docs.python.org/library/os.html

3
  • ack is much more useful than grep if you want to use it to search through your sourcecode files Apr 14, 2011 at 6:15
  • ack isn't installed by default everywhere like grep is. Apr 14, 2011 at 6:17
  • On a development systems that's not really a problem Apr 14, 2011 at 6:18
2

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.

2

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.

1

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.

0

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).

0

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.

0

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

0

Maybe this cheat sheet could come in handy here.

0

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.