{"id":27307,"date":"2018-06-28T04:33:49","date_gmt":"2018-06-28T09:33:49","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=27307"},"modified":"2023-04-05T04:12:47","modified_gmt":"2023-04-05T09:12:47","slug":"create-custom-commands-in-linux","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/create-custom-commands-in-linux\/","title":{"rendered":"How to Create Custom Commands in Linux"},"content":{"rendered":"
<\/div>

\"How<\/p>\n

In this tutorial, We’ll show you how to create custom commands in Linux which will allow you to create “shortcut” commands using a simple name of your choosing. Even better, you can chain multiple commands like this together and run them all with a single word. Useful, right? As you get more and more acquainted with Linux, you’ll come across commands in forums and tutorials that can be really complex (and weird). Consider the following example to print the list of files in a single column:<\/p>\n

ls -l --color | awk '{ print $9 }'<\/pre>\n

This gives us the following output:<\/p>\n

\"Output<\/p>\n

So far so good. But what if you want to use this command frequently? It’s difficult to remember this letter for letter, it’s not easy to type out, and it takes way too long. Now add dozens of other commands with similar (or greater) levels of complexity, and it’s easy to see that we need a new solution.<\/p>\n

\n

Table of Contents<\/p>\n