Linux operating system allows users to create commands and execute them over the command line. To create a command in Linux, the first step is to create a bash script for the command. The second step is to make the command executable. This tutorial will walk you through both steps and show you how to create your own command in Linux.
Creating a Bash Script
To create a bash script, enter the following code:
#on displays the actual folder name
echo "the folder is 'pwd'"
#then the rest of the files
echo "The folder which contains files are 'ls'"
Save this file by pressing CTRL + O with Nano. Give it the name of your command.
Make the Command Executable
If you try to type the name of your bash script, you will notice that it will be executed (run).
Now, you have to modify the CHMOD of the script that you will run by typing:
chmod +x yourScript
Now, copy your script in the path, /usr/bin, like below:
cp yourscript /usr/bin/
You're all done! Run your command by typing the script name, which you moved to /usr/bin.
Image: © Jaroslav Machacek - Shutterstock.com
- Creating new commands in unix
- Create command in linux - Best answers
- Create command linux - Best answers
- Create command button in excel vba - How-To - Excel
- Windows create empty file command line - How-To - Windows 7
- Creating search and update command buttons in a userform ✓ - Forum - Excel
- State information about number and size of partition created - Articles
- Create email account yahoo - Guide