Archive for the ‘Tip of The Day’ Category

Tip of the Day: find string in a file via commandline

Friday, November 13th, 2009

Sometimes we want to know if certain words or strings are in a file.

Fear not, here’s a simple way to do it:

root@localhost ~]# fgrep <keyword> <filename>

Let’s say I’m searching for the string ‘copy’ inside a shell script called check:

root@localhost ~]# fgrep copy check

I’ll get the entire line:

“Copy not finished”;

Tip of the Day: Change hostname via commandline

Monday, July 13th, 2009

To change hostname of your linux box via commandline permanently, type in:
root@localhost ~]# vim /etc/sysconfig/network

replace ‘localhost’ with your desired name.

Then system restart.

Tip of the Day: Know what process is running on a device

Friday, July 3rd, 2009

To get process id running on a device, execute:

root@localhost ~]# fuser -m /dev/sdb1

and then:

root@localhost ~]# ps -p <pid>

Tip of the Day: telnet command

Monday, February 23rd, 2009

Alas! I was able to setup Maestro Project Server via Apache httpd on Linux with Subversion version control system.

Things I did were really simple but I hope I could put them into words and post them here. But right now, I’m sort of caught up on things that need to be done immediately. One of them is finishing a book that I borrowed months ago (or should I say, was lent to me by force and I must read it or else).

However, let me share this to you. It is one of many commands used to test connections when your mail client can’t seem to send and receive mails.

root@localhost ~]# telnet linuxedstuff.com 110

where 110 is the default port number for incoming messages, and 25 is the default port number for outgoing messages.

Tip of the Day: use nbtstat command

Monday, February 16th, 2009

In a LAN, one way of identifying a computer, when all you have is an IP address, is by using nbtstat command.

Simply launch command prompt and type:

C:> nbstat -a 192.168.1.1

It will return the computer’s DNS and mac address.