Tag Archives: linux

Almost all modern shell allows you to search command history if enabled by user. Use history command to display the history list with line numbers. Lines listed with with a * have been modified by user.
Shell history search command

Type history at a shell prompt:
$ history
Output:
Sample output:
6 du -c
7 du -ch
8 ls [01-15]*-2008
9 ls -ld [01-15]*-2008
….
41 g++ prime1.cpp
42 ./a.out
43 ssh ankit@delta
44 scp ~/Desktop/passport.jpg ankit@delta:
45 man expr
46 iptab
47 history

….

996 ping intrarouter.delta.nitt.edu
997 ssh ankit@intrarouter.delta.nitt.edu
998 alias
999 ~/scripts/clean.rss –fetch
1000 vnstat
1001 ~/scripts/clean.rss –update

To search particular command, enter:

$ history | grep command-name
$ history | egrep -i 'scp|ssh|ftp'

Emacs Line-Edit Mode Command History Searching

To get previous command containing string, hit [CTRL]+[r] followed by search string:
(reverse-i-search):

To get previous command, hit [CTRL]+[p]. You can also use up arrow key.
CTRL-p

To get next command, hit [CTRL]+[n]. You can also use down arrow key.
CTRL-n

fc command

fc stands for either “find command” or “fix command. For example list last 10 command, enter:

$ fc -l 10

To list commands 130 through 150, enter:
$ fc -l 130 150

To list all commands since the last command beginning with ssh, enter:
$ fc -l ssh

You can edit commands 1 through 5 using vi text editor, enter:
$ fc -e vi 1 5

Delete command history

The -c option causes the history list to be cleared by deleting all of the entries:
$ history -c

There are total 4 steps involved for hard disk upgrade and installation procedure:

Step #1 : Partition the new disk using fdisk command

Following command will list all detected hard disks:
# fdisk -l | grep '^Disk'

Output:
Disk /dev/sda: 251.0 GB, 251000193024 bytes
Disk /dev/sdb: 251.0 GB, 251000193024 bytes
A device name refers to the entire hard disk.

To partition the disk – /dev/sdb, enter:
# fdisk /dev/sdb
The basic fdisk commands you need are:

  • m – print help
  • p – print the partition table
  • n – create a new partition
  • d – delete a partition
  • q – quit without saving changes
  • w – write the new partition table and exit

Step#2 : Format the new disk using mkfs.ext3 command

To format Linux partitions using ext2fs on the new disk:
# mkfs.ext3 /dev/sdb1


Step#3 : Mount the new disk using mount command

First create a mount point /disk1 and use mount command to mount /dev/sdb1, enter:
# mkdir /disk1
# mount /dev/sdb1 /disk1
# df -H


Step#4 : Update /etc/fstab file

Open /etc/fstab file, enter:
# vi /etc/fstab

Append as follows:
/dev/sdb1 /disk1 ext3 defaults 1 2
Save and close the file.

Task: Label the partition

You can label the partition using e2label. For example, if you want to label the new partition /backup, enter
# e2label /dev/sdb1 /backup

You can use label name insted of partition name to mount disk using /etc/fstab:
LABEL=/backup /disk1 ext3 defaults 1 2

hmmm…eclipse is an amazing ide and there are thousands of well documented plugins available on internet to make the development process much more simpler for developers.

Well it just helps to make your task easy, simple and fast. A few things which can be done using these plugins for eclipse are HTML,XML and XHTML documents validation; editor for JavaScript, CSS, JSP and XML; perl, python and php project development; manage servelets and tomcat from eclipse only ; database management; seperate ide for JS, struts and java server faces; debug your project; manage SVN repositories; track bugs; and lot more…!

the installation process is a piece of cake for everyone.. its really simple.. just a few clicks and its done!

Make sure you have the following packages installed on your system. These are a must for development and running the eclipse client.(just in case)

  1. eclipse-ecj
  2. eclipse-jdt
  3. eclipse-jdt-sdk
  4. eclipse-pde
  5. eclipse-pde-sdk
  6. eclipse-platform
  7. eclipse-platform-sdk
  8. eclipse-rcp
  9. eclipse-rcp-sdk
  10. libgcj-src

Install the required plugins from whichever website you want to install..i have used easyeclipse here.. its a plugin for php development. Install it from here.

We used the following plugins as far as i remember

  • Eclipse html tidy
  • Amateras Html and Xml Editor
  • Ecllipse perl integration
  • Php Eclipse
  • Pydev
  • QuantumDB
  • Amateras IDE
  • SubEclipse (for managing SVN repositories) and others

The documentation about these plugins can be found here.
Download them in a folder on your machine. Separate the features and plugins in two folders, name them features and plugins respectively inside the main eclipse folder.

The features will have a “features.xml” file inside the folders.

After separating them launch eclipse on your machine to install the plugins.

Now goto help on the top menu bar then software updates and then manage configuration

Help –> Software Updates –> Manage configuration

On the left pane,there will be two default entries of /usr/share/eclipse and /usr/lib/eclipse. Right click there and click on “Add an Extension Location“. Now give the path to the main eclipse plugin folder “eclipse” (which contains two folders – features and plugins).

Now close the window and restart eclipse. Thats it.. your plugins have been installed! Yenjoy! :)

ps: whats so good about today!