function command in Linux with examples
Function is a command in linux which is used to create functions or methods.
- using function keyword : A function in linux can be decalred by using keyword function before the name of the function. Different satements can be seperated by a semicolon or a new line.
SYNTAXfunction name { COMMANDS ; }
- using parenthesis : A function can also be decalred by using parenthesis after the name of the function. Different satements can be seperated by a semicolon or a new line.
SYNTAXname () { COMMANDS ; }
- Parameterised function :

$1 will displays the first argument that will be sent and $2 will display the second ans so on… - help function : It displays help information.
Recommended Posts:
- top command in Linux with Examples
- cut command in Linux with examples
- wc command in Linux with examples
- cp command in Linux with examples
- pwd command in Linux with Examples
- ssh command in Linux with Examples
- cc command in Linux with Examples
- apt-get command in Linux with Examples
- for command in Linux with Examples
- rcp Command in Linux with examples
- look command in Linux with Examples
- ip command in Linux with examples
- sum command in Linux with Examples
- tar command in Linux with examples
- fmt command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



