Skamah One
Skamah One

Reputation: 2456

Creating a shortcut or a script in Ubuntu

I just installed Ubuntu (switched from Windows) and I need some sort of an easy way to execute a program with additional arguments.

From the terminal, I'd do this:

/home/steam/steamcmd +login anonymous +force_install_dir /home/steam/css/ +app_update 232330 +quit

Is there a way to make it easier, so I can just double click a shortcut or write something like css_update into my console?

Notice that steam is a custom account created with sudo useradd steam and I don't have permissions to even create a shortcut with the file manager inside the steam directory.

Upvotes: 0

Views: 1031

Answers (1)

aergistal
aergistal

Reputation: 31219

You need a shell script.

Create the file in your home directory. You can use vim or any other text editor.

vim css_update

Press i to activate insert mode and paste the following (Ctrl-Shift-V to paste in a console):

#!/bin/bash
/home/steam/steamcmd +login anonymous +force_install_dir /home/steam/css/ +app_update 232330 +quit

Enter :wq to write and quit.

Make the file exeutable:

sudo chmod +x css_update

To run it from your home directory:

./css_update

Upvotes: 1

Related Questions