Geek Essential

server

Linux Shell Tip

by admin on Nov.17, 2009, under computer, linux, server

Here’s an interesting short cut that I never knew “^” and “!” in linux shell.

It’s an interesting short cut, but it going to need some getting used to.

Link to the original article is listed at the bottom of the page and the original content copied is as below.

Tip: ^ and ! in the shell

I’m astounded. So don’t people know about using ^ and ! in the shell?!? Last week I watched an experienced Linux user carefully hit the ↑ cursor key to get a previous line of history, then ←&→ just to make a simple edit!

Here’s my 30 second guide:

!! Repeat the previous command. Example:

$ ls
bin  d  Desktop  rpmbuild  tmp
$ !!
ls
bin  d  Desktop  rpmbuild  tmp
!-2 (etc) Repeat the command 2 previously (so !! = !-1), or for any number previously. This is the most useful I think.
^foo^bar Replace foo with bar in the previous command. eg:

$ ls -l /etx/httpd/conf.d/local.conf
ls: cannot access /etx/httpd/conf.d/local.conf: No
such file or directory
$ ^etx^etc
ls -l /etc/httpd/conf.d/local.conf
-rw-r--r-- 1 root root 76 2009-07-16 14:59 /etc/httpd/conf.d/local.conf
!foo Run the most recent command that started foo, eg:

$ !ls
ls -l /etc/httpd/conf.d/local.conf
-rw-r--r-- 1 root root 76 2009-07-16 14:59 /etc/httpd/conf.d/local.conf

Today I discovered that these are called event designators. When I first saw someone using them it was on an Apollo workstation circa 1991, and I pretty quickly picked these up myself.

Original Link: http://rwmj.wordpress.com/2009/11/16/tip-and-in-the-shell/

Leave a Comment more...

Debian LAMP Install command

by admin on Sep.24, 2009, under computer, linux, server

Haven’t really touched my home server in a while but planning some upgrade both hardware and software. Including a basic LAMP server.

In order to do this, simply copy and paste following command line for Debian etch

apt-get update
apt-get install apache2 libapache2-mod-php5 php5 php5-cli php5-mysql php5-gd php5-mcrypt mysql-client mysql-server libmysqlclient15-dev phpmyadmin

and follow relevant steps to configure apache, mysql and phpmyadmin and secure it before putting online.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...