Monday, October 25th, 2010, 9:59 am
Cheat Sheets and the Command Line
The command-line access still reigns in the back room
LMOST anything which can be done from the command-line can also be done using a GUI, and vice versa. The question is, which can be done more flexibly and quickly? There is no “correct” paradigm as both are necessary under different circumstances, depending on the nature of the task and the learning curve involved.
Are you a GUI person? Or do you consider yourself to be a command-line guru? A combination of both paradigms is probably the best one can have; it is abundantly clear that some tasks do require a GUI to be carried out efficiently without much training. Standardised syntax and GUI usually ensure that skills are transferable, too.
Personally, I am a GUI person around 95% of the time. I still use the command-line interface on the desktop (e.g. “ffmpeg2theora -p preview –sync ./Desktop/file
“) but especially for quick server operations (e.g. “tail -n600 /var/log/httpd/thelog-error_log
” or “/etc/init.d/httpd restart
” or “vim etc/mime.types
” or “/sbin/iptables -A INPUT -s [IP] -j DROP
“). SFTP with a graphical user interface is still a lot better for certain types of file management tasks. It is impossible to say very generally if a GUI application which accomplishes task X is better than a command-line counterpart. It very much depends on the circumstances and the skills/training. So, to rule out the command-line and calling it arcane or unnecessary is a foolish thing to do.
One of the merits of the command-line is verbosity. It is a merit, not a design flaw or built-in drawback, especially in specific circumstances. I use the command-line interface for little scripts which are better off run manually and in stages because things may go wrong in the middle and easily cause trouble. For instance, here is what I run when a new version of WordPress comes out (3.0.1 in the examples below):
cd wget http://wordpress.org/wordpress-3.0.1.zip unzip wordpress-3.0.1.zip cd ~/wordpress rm wp-config-sample.php rm -rf wp-content/ cp -r * ~/public_html rm -rf ~/wordpress
There is a lot that can go wrong in any of these stages and failure to achieve the task perfectly may mean a broken Web site with little information as to what went wrong or how to fix it.
The bottom line is, do not dismiss those who favour the command-line. These are usually the people who keep the servers you connect to running.
October 27th, 2010 at 3:09 pm
Great blog! I’ve bookmarked it to read it later as I’m pretty new to this. Thanks.