Creating a Linux command

Last update on May 7, 2009 09:23 AM by hyts78
Published by netty5

Creating a Linux command








This article is valid for UNIX systems as well.

What is a command?

Many persons are discouraged to start Linux due to the complex syntax uses(mostly known as Linux command), but what is really a Linux command?
It is a binary file that is launched by typing its name and is intended to achieve a specific action.

Where are these binaries?

The basic commands of Linux (man, cd, ls, pwd, cp, mv, mount, umount ... And so on) are initially found in the /bin directory of your system. The same goes for UNIX. However, files created by the user are placed in /usr/local for reasons of ergonomics.


Using a script

Probably a bit lost at the start in this new environment, here is a little script that you can edit as you wish to understand the commands with the text editor: http://www.adminscripteditor.com/editor/download.asp
To run the script must be an administrator, therefore root.
Once on the main menu is with the keypad that is moving through the menus by entering the number of the selected menu!

Conclusion

To create Linux commands or Unix, just write the code of this command, to compile and place the binary file in/bin directory of your system.

Remember to make it executable with chmod a + x file.
Best answers for « Creating a Linux command » in :
Create your own command on linux Show Create your own command on linux Creating a Bash script Turning the command active (Executable) Creating a Bash script It’s important to create a Bash script which will run your command. Let’s see: #!/bin/bash #on displays the...
Linux commands Show Table of main Linux commands Command Description DOS equivalent ls lists the content of a directory dir cd change directory cd cd .. parent directory cd.. mkdir creates a new...
Command to detect your IP address! ShowCommand to detect your IP address! Command for Windows 2000 / XP / Vista Command for Windows 95/98 Command for Linux IP address (Internet Protocol) is a numerical identification to detect your computer on a network. It is used to...
List of open ports in command line ShowList of open ports in command line Whether you're running Windows or Linux / Unix, the following command in (console) will display the list of open ports on your computer: netstat -a For the use of advanced graphics tools, see What...
How to Resize a Partition using Gparted on Linux? ShowHow to Resize a Partition using Gparted on Linux? You have a partition and you want to enlarge or reduce it without losing data? It is possible and relatively easy with GParted, a LiveCD, ie a bootable CD, providing an interface...
Download LC ISO Creator ShowLC ISO Creator is very simple: it allows to create a .ISO file from your CD. Then, it allows you to burn these ISO files, to use CD emulation software (in order not to use any more the original CD) or to make a backup copy. The software is...
Linux - The shell ShowIntroduction to the shell The command interpreter is the interface between the user and the operating system, hence the name "shell". The shell therefore acts as an intermediary between the operating system and the user thanks to command lines...
Linux - Tree structure of files ShowFile hierarchy under Linux To ensury compatibility and portability, Linux systems comply with the sole FHS (File Hierarchy Standard) standard. The basic hierarchy is as follows: /the root, containing the main directories /bincontains...
Linux - User management ShowFirst step for the administrator When several people have access to a system, the administrator must manage the users. To do so, he must know the common commands and files to be configured. The important files are: the /etc/passwd file the...