Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-12-2006, 05:10 AM   #1
Karthikeyan Gurusamy
LQ Newbie
Registered: Dec 2005
Posts: 14

Rep: Reputation: 0
What is patch


Can anybody please tell me about patch in linux?

For what purpose patch is created and used?


Old 01-12-2006, 06:10 AM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 75
If you run "man patch" on any Linux or Unix based system, or search the web for "man patch", "patch manual" etc, you will get detailed info about what patch is and what it does.
Old 01-12-2006, 06:11 AM   #3
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
man patch:

patch takes a patch file patchfile containing a difference listing pro-
duced by the diff program and applies those differences to one or more
original files, producing patched versions.

In other words it's used to apply precreated (usuall with diff command) patches (=lists of changes to be made) to files.
Old 01-12-2006, 06:26 AM   #4
Karthikeyan Gurusamy
LQ Newbie
Registered: Dec 2005
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks alien!

can we say patch is like program to fill the defectives of
previous version of one program?


Old 01-12-2006, 06:36 AM   #5
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Good link taken directly from the kernel source:

A patch is a text document to change something from one version to another. As you said, it can correct bug but can also add some special functionnality.
Old 01-12-2006, 10:07 AM   #6
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,976
Blog Entries: 4

Rep: Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136Reputation: 3136
In the "old days," patches were used a lot more because they were smaller than the source-files that they patched. Nowadays they are most useful for documenting the differences between the "old" and "new" version of a particular text-file. Any difference, no matter how slight, will be detected.

patch can take a patch-file and source-file as input and produce a modified source-file as output. The process is based on the diff (file-difference) command and it's quite "smart."

The contents of a patch-file are contextual, not based on line-numbers but on content. The CVS version-control system is also based on this technology.

Last edited by sundialsvcs; 01-12-2006 at 10:08 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to patch kernel with Reiser4 mm patch SlackwareInAZ Slackware 9 04-26-2005 06:33 AM
Patch-o-matic TTL Patch Knopper Fedora 1 02-02-2005 10:27 AM
How to Install patch-o-matic(a iptables patch) on redhat 9? itebooks Linux - Security 1 07-23-2004 08:51 AM
debian-patch-debianlogo w/2.6.5 kernel-patch-lpp Outabux Debian 11 05-20-2004 01:21 PM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration