24 May 2009

Commonly used Linux/Unix commands

Bellow are some of commonly used Linux shell command which usually used every day



Starting and Ending

login: `Logging in'
ssh: Connect to another machine
logout: `Logging out'

File Management


emacs: `Using the emacs text editor'
mkdir: `Creating a directory'
cd: `Changing your current working directory'
ls: `Finding out what files you have'
cp: `Making a copy of a file'
mv: `Changing the name of a file'
rm: `Getting rid of unwanted files'
chmod: `Controlling access to your files'
cmp: Comparing two files
wc: Word, line, and character count
compress: Compress a file

Communication


e-mail: `Sending and receiving electronic mail'
talk: Talk to another user
write: Write messages to another user
sftp: Secure file transfer protocol

Information


man: Manual pages
quota -v: Finding out your available disk space quota
ical: `Using the Ical personal organizer'
finger: Getting information about a user
passwd: Changing your password
who: Finding out who's logged on

Printing


lpr: `Printing'
lprm: Removing a print job
lpq: Checking the print queues

Job control


ps: `Finding your processes'
kill: `Killing a process'
nohup: Continuing a job after logout
nice: Changing the priority of a job
&: `What is a background process?'
Cntrl-z: Suspending a process
fg: `Resuming a suspended process

24 April 2009

How to Add DNS in Linux using shell script

If you want to add DNS server in linux. The fastest way is using shell script.
Here is fastest way to add DNS server in Linux

edit /etc/resolve.conf with your favorite editor (gedit,nano,vim, vi...etc)

for each name server add
nameserver <ip>

06 March 2009

How to make partition in Linux using Gparted

If you want to make partition in Linux, you can use Gparted for that.
Here is how to make partition using gparted

  1. Downloaded Gparted Live 0.3.1-1 Burned as ISO using K3B.
  2. Booted into XP and verified that I had all my music, videos, and documents backed up to the fat32 partition. Deleted all copies on ntfs partition. Opened add remove programs and uninstalled all the Windows versions of programs that I also have on Ubuntu and all programs that I rarely used. Retained all programs that I might use if I ever boot into XP again. Opened and ran disk cleanup wizard. Ran disk defragmenter about five times.
  3. Rebooted with Gparted Live disk. Wow! Amazing program. Only 85MB on the disk and loads linux to ram in less than two minutes! Resized ntfs from 97GB to 40GB.
  4. Decided to use some of that 50GB of free space to try Edgy Eft Knot3. Downloaded, burned as ISO (K3B again), and rebooted. Booted live Edgy disk, clicked the install icon, and ran into a little problem. My disk already had four primary partitions and the newly freed space was not in the extended partition. Was unable to proceed using installation partitioner.
  5. Rebooted with Gparted Live disk. First, I moved my second primary partition (/home) as far left as I could enlarging it by about 10GB as I did. This placed the free space next to my extended partition. Second, I enlarged the extended partition to encompass the free space.

05 February 2009

How to check IP In Linux

In Linux, you can use Shell Command to find or get IP address
It displays Ethernet IP address, Mac address, subnet mask and other information.
Type /sbin/ipconfig command to display IP address:

Code:

$ /sbin/ifconfig

Code:

$ /sbin/ifconfig | less


Under Solaris and other Unixish oses you may need to type ifconfig command with -a option as follows:

Code:

$ /sbin/ifconfig -a
Output sample

Code:

eth0     Link encap:Ethernet  HWaddr 00:0F:EA:91:04:07
  inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
  inet6 addr: fe80::20f:eaff:fe91:407/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:31167 errors:0 dropped:0 overruns:0 frame:0
  TX packets:26404 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:38338591 (36.5 MiB)  TX bytes:3538152 (3.3 MiB)
  Interrupt:18 Base address:0xc000

03 January 2009

Package Management in Linux

Here are some package managemen in Linux

Synaptic
Synaptic is a graphical user interface (GUI) for managing software packages on Debian-based distributions. If you are using Debian or Ubuntu you will easily find Synaptic in the System Tools menu or in the Administration menu. Synaptic uses the GTK graphic libraries . So, if you are using GNOME on your debian-based distro you will probably have Synaptic installed as well. Synaptic is a graphical package management program for apt. It provides the same features as the apt-get command line utility with a GUI front-end based on Gtk+. http://www.debianadmin.com/

Yum
Yum is the easiest way to keep all programs up to date. It downloads and installs the latest version of a program. A single command can update all software installed, including third-party software, security updates and operating system. It can do the updating automatically in the night. In this howto, we install yum and make it do all the above.
Yum is similar to, but better than apt, apt4rpm, windows update, up2date, yast and many other package managers I have seen. Yum works in a safe, standardized way. It uses rpm (Red Hat package manager) for installing programs. Authenticity of packages is checked with strong gpg encryption. Package repositories are just folders on a web server.