Linux

Shell Script in 5 minutes!

Posted by 18 September, 2010 (0) Comment

Shell scripts are short programs that are written in a shell programming language and interpreted by a shell process. They are extremely useful for automating tasks on Linux and other Unix-like operating systems.

1. Here is very short tutorials to make a very basic shell scripting.
. open vi or any other advance editor like vim

#!/bin/bash
clear
pwd
echo "Hello phpmind, world."

2. Save this script and give a name for example “phpmind.txt”
3. phpmind will be your command.
4. To run your command type ./phpmind
5. If its says Permission denied then use chmod 755 phpmind
6. Now the script is ready to run by typing the following, again while in the same directory, and then pressing the ENTER key:
./ phpmind

How It Works

The first of the three lines tells the operating system what shell to use to interpret the script and the location (i.e., absolute pathname) of the shell. The shell is bash, which is located in the /bin directory (as are all shells); thus the line contains /bin/bash. This instruction is always preceded by a pound sign and an exclamation mark in order to inform the operating system that it is providing the name and location of the shell (or other scripting language).
The second line tells the shell to issue the clear command. pwd (which shows the current directory),
The third line tells the shell to write the phrase Good morning, world. on the screen. It uses the echo command, which instructs the shell to repeat whatever follows it.

Share
Categories : Shell Script Tags :

Linux Beginner Practice using command line tool.

Posted by 11 May, 2010 (8) Comment

PhpMind Linux Practice Command line.

LAMP is growing very fast from small business to Enterprise level.
Every one is looking for LAMP developers.  Most of them are very good in PHP and MYSQL but in Interview Interviewer stat asking about Apache and Linux questions they keep  mum!!

This is for php beginners those who want to learn Linux and don’t have command line facility to practice.  Its easy like  1 2 3 !!

1. Open this link  – Linux Practice for beginners.

2. Open terminal -

3. Start working.

Share
Categories : Linux Tags :

How to copy an entire directory in Linux?

Posted by 18 February, 2009 (0) Comment

cp -R Blog/ Newblog/

Using this command you can copy an entire directory, its subdirectories, and files. Blog is existing directory and Newblog is destination directory.

Share
Categories : Linux Commands Tags :

Linux faqs

Posted by 20 January, 2009 (0) Comment

How to find out which Linux version you are running?
# cat /proc/version

Output – Linux version 2.6.27-6_1.intel.BHsmp (kernel@bluehost.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Thu Nov 13 15:27:29 MST 2008

how do I show all installed packages in Linux?
# rpm -qa | less
This workes in Red Hat/Fedora Core/CentOS Linux


Share
Categories : Linux FAQ Tags :

Why you should use Linux?

Posted by 16 January, 2009 (0) Comment
  • Unlike many single user desktop console based operating systems, Linux is a multi-user, multi-tasking, network enabled operating system accessible from anywhere on the network.
  • Multiple users can access a Linux computer remotely, each running their own individual desktop instance, all at the same time.
  • The Linux/Unix X-Windows network enabled multi-user windowing system allows full remote access.

    This is a sharp contrast to a single user console based OS which requires the user to be physically present at the computer in order to access his desktop and applications, limiting access to one user at a time.

  • The Linux/Unix OS was designed to support remote and secure multi-user access using ssh.
  • This gives all Linux/Unix administrators and users a powerful flexible standard remote interface while the automobile is often the primary remote access tool of other OS administrators (i.e. Windows 98 and NT).
  • Linux/Unix shell scripts provide a batch scripting capability which can be scheduled, propagated to other systems.
  • Future and advanced development is ensured as the source code is available to all. It is studied in universities and institutions worldwide.
  • PhD candidates and corporate researchers use Linux to try advanced computing concepts.
  • Linux is here to stay; it is getting stronger day by day, and that is good from a technical, financial and economic point of view.
Share
Categories : Linux Tags :