Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, October 18, 2010

Submitting project into cvs in linux

Today we will see one of  important topic regarding CVS(Concurrent Versions System).  
How to Submit project into cvs in linux.
open the terminal
enter into the root
navigate to the project folder say /home/subin/Desktop/Projectname(Come inside project folder)
type below command
cvs import -m "new Projectname" -I ! -W "*.doc -kb" -W "*.gif -kb" -W "*.JPEG -kb" -W "*.jar -kb" -W "*.BMP -kb" -W "*.jpg -kb" -W "*.PNG -kb" Projectname nic v20

cvs commit;
Now project has been submitted to CVS successfully
To check out project from cvs type below command

cvs checkout Projectname

chmod -R 777 Projectname  --- this command will give permissions to access all sub folders and files (read, write, modify)

Thursday, September 9, 2010

Configuring Java environment in Linux

After installing Java Development Kit(JDK) or Java Runtime Environment(JRE) on Linux, you have to configure java for running or compiling java programs.
JDK is usually installed into /usr/java directory
now open the terminal
now open the bashrc file which is present in /etc directory by using 
command vi bashrc 
[subin@wipro-049cafd91 jet7.0-pro]$ cd ..
[subin@wipro-049cafd91 ~]$ pwd
/home/subin[subin@wipro-049cafd91 ~]$ cd /
[subin@wipro-049cafd91 /]$ pwd
/
[subin@wipro-049cafd91 /]$ cd /etc
[subin@wipro-049cafd91 etc]$ pwd
/etc
[subin@wipro-049cafd91 etc]$ vi bashrc

To edit the bashrc file to configure java, press "Insert" button in keyboard

export JAVA_HOME=/usr/java/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
export CLASSPATH=/usr/java/jdk1.6.0_14/lib/tools.jar: \ /usr/java/jdk1.6.0_14/lib/dt.jar

Once you have edited your .bashrc file
press "escape" button in keyboard
and type ":wq!" and press enter
you can see

[subin@wipro-049cafd91 etc]$ 

Execute the following command to make the bash shell to re-read the contents of the .bashrc file 
[subin@wipro-049cafd91 etc]$ source ~/.bashrc

Now you can compile and execute Java programs in Linux.

Monday, August 30, 2010

Configuring Netbeans with firefox in linux

In Netbeans

Tools--options--general

in that web browser field --- select firefox

and click on edit button

Name Firefox   

Process /usr/local/bin/firefox/firefox

Arguments {URL}


Note : In my linux system firefox is installed in /usr/local/bin/firefox

Inside this there will be one file called firefox, we have to give path up to here
(this is nothing like .exe file in windows)

Sunday, August 29, 2010

Zip and Unzip file in linux

The zip and unzip programs work almost exactly like their cousins PKZIP and PKUNZIP in the DOS environment. You can squash a bunch of files together into a zip file like this:

zip test.zip file1 file2 file3

Then you can extract the original files like this:

unzip test.zip

Wednesday, August 25, 2010

Configuring firefox browser in Linux


In panel you can see web browser icon, right click on it, select properties option
Now you can find "Launch Properties" window, in that "command" field you can browse the Firefox path where Firefox is installed in your system

for ex: /usr/local/bin/firefox/firefox

or u can view simply htmlview %u

Tuesday, August 24, 2010

Deleting folders/sub folders/files in linux

rm myfile.txt

Remove the file myfile.txt without prompting the user.

rm -r directory

Remove a directory, even if files existed in that directory. 

Note: if you use rm to remove a file, it is usually possible to recover the contents of that file. If you want more assurance that the contents are truly unrecoverable, consider using shred.

rmdir mydir - removes the directory mydir

shred myfile.txt

Permanently deleted and makes the file myfile.txt unrecoverable (unless stored elsewhere or on a backup).

Thursday, June 17, 2010

Giving Read,Write and Edit permission to a folder in linux

open the terminal
navigate to the particular folder to which we should give permission say validator folder

[subin@wipro-049cafd91 Desktop]$ chmod 777 validator

This will give read, write and edit permissions to validator folder, but the folders(sub folders) present inside the validator folder we don't have permission to access, again we have to do chmod for each and every subfolder

In-order to overcome this problem, we have to use following command

[subin@wipro-049cafd91 Desktop]$ chmod -R 777 validator

This will give read,write and edit permissions to entire folder, including subfolders and files

SCP Command in Linux

scp stands for secure copy, which is a remote file copy program

The scp command allows you to copy files over ssh connections. This is pretty useful if you want to transport files between computers, for example to backup something.

The scp command can be used in three ways:

1.To copy from a (remote) server to your computer

scp -r [login name@ip address] : [/path/filename] .

Ex: scp -r sravan@10.1.14.36:/home/sravan/Desktop/test /home/subin/Desktop

Ex: scp -r sravan@10.1.14.36:/home/sravan/Desktop/test .


Here are the meaning of scp command options:

* -r = recursively copy entire directory
* . = current directory

'/path/filename' is the complete directory path and name where the file resides.

'login name@ip address ' is the target/destination computer. You have to provide your login name and ip address and will be asked for user password.

Dot (.) at the end of the command means the files will be copied to the current directory. Of course you can change the destination to any directory you wish, just type the full path and directory name to replace the dot(.).

2.To copy from your computer to a (remote) server

scp -r [/path/filename] [login name@ip address] : .

Ex : scp -r /home/subin/Desktop/abc sravan@10.1.14.36:.

Ex : scp -r /home/subin/Desktop/abc sravan@10.1.14.36:/home/sravan/Desktop

3.To copy from a (remote) server to another (remote) server.

In the third case, the data is transferred directly between the servers; your own computer will only tell the servers what to do.

scp yourusername@yourserver:/home/yourusername/examplefile yourusername2@yourserver2:/home/yourusername2/

Ex : scp sravan@10.1.14.108:/home/sravan/xyz subin@10.1.14.109:/home/subin

Tuesday, June 15, 2010

How to Find the Process ID(PID) of Task and Killing the Task in Linux

open the terminal

switch to the root, by using following command
[subin@wipro-049cafd91 ~]$ su -
Password:
enter the root password and click on enter it will enter into the root
[root@wipro-049cafd91 subin]#

then enter the following command
[root@wipro-049cafd91 subin]# top

on clicking enter, it will show all the tasks which are currently in the host
by seeing the PID of the task, we can kill that particular task in the following way
before that you have to come out of the "top", for that press ctrl+c

now enter the following command
[root@wipro-049cafd91 subin]# kill 54789
on clicking enter this will kills the task in the host

Another way of finding the PID of task :
enter the following command in terminal
[root@wipro-049cafd91 subin]# ps aux | grep firefox

Note: here "firefox" is task name, it can be any task like netbeans, a folder, a file ........

by entering the above command it will gives the pid(process id) of the task

subin 27819 0.0 0.1 4436 1088 ? S 11:42 0:00 /bin/sh /usr/lib/firefox-1.5.0.9/firefox
subin 27842 0.0 0.1 4440 1096 ? S 11:42 0:00 /bin/sh /usr/lib/firefox-1.5.0.9/run-mozilla.sh /usr/lib/firefox-1.5.0.9/firefox-bin
subin 27847 7.7 2.6 94848 26840 ? Sl 11:42 0:00 /usr/lib/firefox-1.5.0.9/firefox-bin
root 27855 0.0 0.0 3884 692 pts/1 S+ 11:42 0:00 grep firefox

then enter the following command to kill the process

kill 27847

by this we can kill the firefox

How To Start, Stop and Restart Oracle Listener in Linux

open the terminal

switch to the root, by using following command

[subin@wipro-049cafd91 ~]$ su -
Password:

enter the root password and click on enter it will enter into the root

[root@wipro-049cafd91 subin]#

then enter the following command

[root@wipro-049cafd91 subin]# su - oracle

To Start Listener :

[root@wipro-049cafd91 subin]# lsnrctl start

To Stop Listener :

[root@wipro-049cafd91 subin]# lsnrctl stop

To Restart Listener :

[root@wipro-049cafd91 subin]# lsnrctl reload

Available Listener Commands :

lsnrctl help command will display all available listener commands. In Oracle 11g following are the available listener commands.

* start - Start the Oracle listener

* stop - Stop the Oracle listener

* status - Display the current status of the Oracle listener

* services - Retrieve the listener services information

* version - Display the oracle listener version information

* reload - This will reload the oracle listener SID and parameter files. This is equivalent to lsnrctl stop and lsnrctl start.

* save_config – This will save the current settings to the listener.ora file and also take a backup of the listener.ora file before overwriting it. If there are no changes, it will display the message “No changes to save for LISTENER”

* trace - Enable the tracing at the listener level. The available options are ‘trace OFF’, ‘trace USER’, ‘trace ADMIN’ or ‘trace SUPPORT’

* spawn - Spawns a new with the program with the spawn_alias mentioned in the listener.ora file

* change_password – Set the new password to the oracle listener (or) change the existing listener password.

* show - Display log files and other relevant listener information.

Monday, June 14, 2010

Command for Finding IPAddress of system in Linux

open the terminal

Enter the following command

/sbin/ifconfig

by typing this command you can see the summary in the terminal, in that summary you can find the "inet addr"

inet addr is the ipaddress of the host/system

Saturday, June 12, 2010

Deleting Folders/Files from Trash in Linux

Sometimes we can't delete folders/files which are present in Trash, because of some permissions problem, in that case

Open the terminal

switch to the root, by using following command

[subin@wipro-049cafd91 ~]$ su -
Password:

Enter the root password and click on enter it will enter into the root

[root@wipro-049cafd91 subin]#

Navigate to the following folder

[root@wipro-049cafd91 subin]# cd /home/subin/.Trash

Note: In linux Hidden folders will start with "."

Now enter the following command to delete folders/files in trash folder

[root@wipro-049cafd91 subin]# rm -rf *

This will delete all folders/files in trash folder

Friday, June 11, 2010

Installing Postgres Database Software in Linux

Open the terminal
switch to the root, by using following command
[subin@wipro-049cafd91 ~]$ su -
Password:
Enter the root password and click on enter it will enter into the root
[root@wipro-049cafd91 subin]#
then go to folder where postgresql software is present
[root@wipro-049cafd91 subin]# cd Softwares

press enter.....
[root@wipro-049cafd91 Softwares]#
then type the following command

[root@wipro-049cafd91 Softwares]# chmod +x postgresql-8.4.0-1-linux.bin
[root@wipro-049cafd91 Softwares]# ./postgresql-8.4.0-1-linux.bin

this will installs the postgressql software in your host/system.

Wednesday, June 9, 2010

Installing NetBeans Software in Linux

Open the terminal
switch to the root, by using following command
[subin@wipro-049cafd91 ~]$ su -
Password:
Enter the root password and click on enter it will enter into the root

[root@wipro-049cafd91 subin]#
go to folder where netbeans software is present in your host
[root@wipro-049cafd91 subin]# cd Softwares
press enter.....

[root@wipro-049cafd91 Softwares]#
then type the following command
[root@wipro-049cafd91 Softwares]# sh netbeans-6.5.1-ml-linux.sh
press enter.....

by this NetBeans Software will install in Linux

Installing Java Software in Linux

Open the terminal

switch to the root, by using following command
[subin@wipro-049cafd91 ~]$ su -
Password:
Enter the root password and click on enter it will enter into the root

[root@wipro-049cafd91 subin]#
then go to folder where java software is present in your host
[root@wipro-049cafd91 subin]# cd Softwares
press enter.....

[root@wipro-049cafd91 Softwares]#
then type the following commands
[root@wipro-049cafd91 subin]# chmod +x jdk-6u14-linux-i586-rpm.bin
[root@wipro-049cafd91 subin]# ./jdk-6u14-linux-i586-rpm.bin

go on clicking "more" and at last type "yes", by this java software will install in linux.

Shell in Linux

A shell is a command-line interpreter: it takes commands and executes them.Bash (Bourne-again shell) is the default shell for most current Linux distributions (and Mac OS X) and can be run on most Unix-like operating systems.To check what shell you are currently using, open the console, type echo $SHELL, and press Enter. It should return a pathname ending with /bash.

Editors in linux -   nano,vi,vim(vi improved),pico

Tuesday, June 8, 2010

Basic commands for vi editor

I   Insert text before the cursor
A   Insert text after the cursor
:   Switch to execute mode
$   Go to last place on the line
^   Go to first place on the line
W   Next word
B   Previous word
Y   Copy. (Note: Y3W = copy 3 words; Y3J = copy 4 lines.)
P   Paste
D   Cut
X   Delete character under the cursor
®   Move cursor one space right.
¬   Move cursor one space left.
-   Move cursor up one line.
_   Move cursor down one line.
$   Move cursor to end of line.
^   Move cursor to beginning of line.
:1   Move to first line of file
:$   Move to last line of file
/   Search for a character string.
?   Reverse search for a character string.
x   Delete the character at the cursor position.
dd   Delete the current line.
p   Paste data that was cut with x or dd commands.
u   Undo.
ctrl-F   Move forward one screen.
ctrl-B   Move backward one screen.
Shift-G    Last line of the file
20 Shift-G   Go to line 20
:/wordname   to search any word in file.
:set number   to give numbering in file.
:set autoindent   to give auto numbering in file.


Note: esc or Escape command will Switch from Input mode to Command mode.
For edit,save or quit the file we have to press esc before using below commands

:w   to save file.
:q!   to quit without saving.
:wq   to save and quit.

Monday, June 7, 2010

Basic Linux Commands

A shell is a command-line interpreter: it takes commands and executes them.Bash (Bourne-again shell) is the default shell for most current Linux distributions (and Mac OS X) and can be run on most Unix-like operating systems.To check what shell you are currently using, open the console, type echo $SHELL, and press Enter. It should return a pathname ending with /bash.

W - shows all users and what they are doing
finger - displays information about system users
who - show who is logged on
pwd - print working directory
history-shows previous used commands
uname - shows system information
ip addr - reports your IP address
ls - displays directory contents
ls -l - like ls,but in a more readable format
su - switch user/super user
nano - basic text editor
kwrite - gui text editor
free - display memory usage
df - displays free disk space(df -h - displays in more readable format)
man [command] - gives more information about command
ps - lists the current running processes on your Linux system
kill and killall commands - used to kill|terminate running processes

whoami - prints ur login name
last-Show listing of users last logged-in on your system.
history | more - Show the last (1000 or so) commands executed from the command line on the current account. The "| more" causes the display to stop after each screenful.
uptime - Show the amount of time since the last reboot.
top - Keep listing the currently running processes, sorted by cpu usage (top users first). In KDE, you can get GUI-based Ktop from "K"menu under "System"-"Task Manager" (or by executing "ktop" in an X-terminal).

vi editor in linux

The VI editor is a screen-based editor.
The VI editor allows a user to create new files or edit existing files. The command to start the VI editor is vi, followed by the filename.

For example open terminal and enter vim test.txt this will open a new file named test,if the file is not present it will create a new file, here to enter text in this file, press Insert button in keyboard, so that we can enter some text in the file and press Esc:wq for saving the file.