Tuesday, December 8, 2009

Some Usefull LINUX Commands

Dear All,
I am listing some linux commands which can help you to get arround Linux (RHEL 5)

Command Uses

clear Clearing the screen

date To see The current date and time

date 12923202009 Sets the time and date to 9-Dec-09 11:20 PM

cal display current month calendar

cal 2010 display calendar for 2010

pwd your current location in system

cat filename show the contect of the file specified, on the screen

head filename show the first 10 lines of the file specified, on the screen

tail filename show the last 10 lines of the file specified, on the screen

rm filename Removes a file

rm -rf Dirname deletes NON-Empty directory

rmdir Dirname removes a EMPTY dir

locate filename finds all files matching the filename (you are required to run updatedb before running this command)

find / -name filename search for the file in the system

cd location changing directory to the specified location

EX: cd /etc

seq 100 display a count from 1 to 100 on screen

man commandname To get help on the specified command

chvt 3 switching to CUI tty3 from GUI terminal window
































































































































Installing YUM Server STEP BY STEP

You need a RHEL5 installed Machine and RHEL5 DVD for this Practical, I have used My server's IP address as 10.0.0.2 :

Now follow these steps:
  1. install vsftpd package from DVD, steps are :
    From CUI: rpm -ivh /dev/cdrom/Server/vsftpd-*
    From GUI: Navigate through your DVD --> Server --> Look for file name starting with vsftpd and double click on it.
  2. Now similarly install createrepo Package.(Just replace vsftpd with createrepo from above step)
  3. Now copy "Server" Directory from your DVD to the location /var/ftp/pub.
  4. Now at Terminal type following command:
    createrepo -v /var/ftp/pub/Server
  5. Next change your directory to /etc/yum.repos.d/ by using command:
    cd /etc/yum.repos.d
  6. Now using a text editor create a file with ".repo" extension, I used nano,
    nano server.repo
  7. Now write these lines in the file, just replace "10.0.0.2" with the ip address of your machine:
    [Soft server]
    name=YUM Server
    baseurl=ftp://10.0.0.2/pub/Server
    enabled=1
    gpgcheck=0
  8. save the file using ctrl+o, now press ENTER to accept the file name to write and exit with ctrl+x.
  9. If you performed all the above steps without fail then you re done with your server side configuration.
  10. Now just copy the file "server.repo" to your client machine,by using the following command on your client LINUX machines:
    scp root@10.0.0.2:/etc/yum.repos.d/server.repo /etc/yum.repos.d/
    you may be asked to continue type "yes" and press ENTER, now wait system will ask you to enter server's root password.
That's it you have successfully configured a YUM SERVER with it's clients. You can install any software available on DVD by using these simple commands:

TO INSTALL A SOFTWARE: yum install packagename
TO REMOVE A SOFTWARE: yum remove packagename
TO SEE ALL INSTALLED AND AVAILABLE PACKAGES : yum list all

Try this Now and tell me in the comments what other info you required on this blog.