- How to Create Shortcut Commands using Alias in Linux
- Create Shortcut Command
- Make Shortcut Permanent
- Create More Shortcut Commands
- View all Shortcuts (Aliases)
- Remove Shortcuts
- How to create desktop shortcut or launcher on Linux
- Create a Desktop Shortcut From the Command Line
- Create a Desktop Shortcut on GNOME Desktop
- Create a Desktop Shortcut on KDE Desktop
- Create a Desktop Shortcut on Xfce Desktop
- Create a Desktop Shortcut on Cinnamon Desktop
- Create a Desktop Shortcut on LXDE Desktop
- Support Xmodulo
- How to make a desktop shortcuts on Ubuntu 20.04?
- 13 Answers 13
- For Application Shortcuts:
- For Folder/File shortcuts:
How to Create Shortcut Commands using Alias in Linux
In this tutorial you will learn, how to create shortcut commands on Linux. This is you can say a short name of any command. In you daily work, you use multiple commands very frequently. You can create a shortcut of those commands, which help you to use easier.
Alias is an Linux command provides ability to create customized commands. Using this you can create a sort name for a big command as an alias, which is easier to remember. When we uses a single command very frequently, we can alias them to a very short name. You can understand it as create shortcut commands on Linux.
Create Shortcut Command
For example, we use below command frequently to view the directory listing in human readable format.
Now, make it short with alias command.
All done, You have created the alias successfully. To verify the newly created alias, just type below command on terminal
You will see the results on screen similar to command “ls -lh”.
Make Shortcut Permanent
When you create an alias on terminal, it is not available permanently. Once the terminal is closed, the aliase are lost. To make the aliases permanently you can write in login or non login shell script.
Add the aliases in /etc/profile.d/bash_aliases.sh (Use any name for this script) to make them available for all users. To configure aliases for specific user only, add them in
Create More Shortcut Commands
You can create multiple shortcut commands as much you need. Here is the aliases of some frequently used commands. Add these commands to shell script.
View all Shortcuts (Aliases)
You can simply type the “alias” command without any parameter to print all available aliases on your system.
Remove Shortcuts
You can use unalias command to disable any shortcut on your system. For example to disable ‘lh’ alias use following command.
You also need to remove any entry made in login or non login shell scripts.
Источник
How to create desktop shortcut or launcher on Linux
Last updated on November 11, 2020 by Dan Nanni
If you have a program you use regularly on Linux desktop, you may want to create a desktop shortcut, so you can launch the program by simply clicking on the shortcut. While most GUI programs automatically create their desktop shortcut during installation, GUI programs built from their source or terminal applications may require you to set up associated shortcuts manually.
In this tutorial, I will describe how to create a desktop shortcut or launcher in various Linux desktop environments.
A desktop shortcut is represented by a corresponding .desktop file which contains meta information of a given app (e.g., name of the app, launch command, location of icon file, etc.). Desktop shortcut files are placed in /usr/share/applications or
/.local/share/applications . The former directory stores desktop shortcuts that are available for every user, while the latter folder contains shortcuts created for a particular user only.
Create a Desktop Shortcut From the Command Line
To manually create a desktop shortcut for a particular program or command, you can create a .desktop file using any text editor, and place it in either /usr/share/applications or
/.local/share/applications . A typical .desktop file looks like the following.
Besides manually create .desktop file, there are various desktop-specific ways to create an application shortcut, which I am going to cover in the rest of the tutorial.
Create a Desktop Shortcut on GNOME Desktop
In GNOME desktop, you can use gnome-desktop-item-edit to configure a desktop shortcut easily.
In this example, gnome-desktop-item-edit will automatically create a desktop launcher file in
/.local/share/applications . To customize icon location and other info, you may have to edit the .desktop file manually afterward.
If gnome-desktop-item-edit is not available (e.g., on Ubuntu), you can install it as follows.
Create a Desktop Shortcut on KDE Desktop
kickoff is the default application launcher in KDE desktop. Adding a new application shortcut to kickoff is straightforward.
First, right-click on kickoff icon located at the left bottom corner of your desktop, and then choose Edit Applications menu.
Click on an appropriate category (e.g., Utilities ) under which you want to create a shortcut, and click on New Item button on the top. Type in the name of the app.
Finally, fill in the meta information of the app being launched by the shortcut.
Create a Desktop Shortcut on Xfce Desktop
If you are on Xfce desktop, right-click on the desktop background, and then select Create Launcher menu. Then fill out the details of the shortcut.
Create a Desktop Shortcut on Cinnamon Desktop
If you are on Linux Mint Cinnamon desktop, you can create an application launcher by right-clicking on the desktop background, and selecting Create Launcher menu.
Create a Desktop Shortcut on LXDE Desktop
On LXDE desktop, simply right click on the desktop background, and choose Create New Shortcut .
Support Xmodulo
This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin ( 1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g ).
Источник
How to make a desktop shortcuts on Ubuntu 20.04?
Let’s add some fresh knowledge to the forum now Ubuntu 20.04 is out =). My question today is simple; what is the most elegant way to create desktop shortcuts (e.g. to folders, applications or documents) in Ubuntu 20.04?
13 Answers 13
You can copy a file from /usr/share/applications to your desktop folder (
/Desktop ) using the cp command. Then right click the .desktop file and select ‘allow launching‘.
An example would be
Make sure to include the .desktop ending.
You might also have to allow launching for an existing .desktop file after upgrading to Ubuntu 20.04.
For Application Shortcuts:
I think TheBuntuNewb’s answer is pretty good. Do that using file manager:
- Open /usr/share/applications
- Copy the application shortcut to desktop
- Right click on the shortcut on the desktop and select Allow Launching
For Folder/File shortcuts:
Either directly use the terminal to create a symbolic link
Open the folder in the file manager (nautilus), navigate to the directory to which you want to create a shortcut to.
Right click and select Open in Terminal.
For shortcut to current directory, type and execute
For shortcut to a file/folder inside the current directory, type and execute
Easy graphical way:
- show your desktop in your home directory
1.1. enable symbolic links in nautilus: Settings → Behavior → [x] Show action to create symbolic links
open two windows of nautilus. one for the desktop, second for the shortcut you want to produce.
click the item the shortcut has to produced for with the left mouse button and drag it to the desktop folder in your home directory with the ALT-key pressed.
when you leave the item on the desktop folder a context meune appears, that give you three options. One of them is «create symbolic link» or so.
Then you’re done.
Its awful, that this simple feature has to be done the complex way.
On default DE (Gnome 3) symlinking does not work, but .desktop files copying works as TheBuntuNewb said:
For Lubuntu 20.04 desktop the next works:
Displaying items on the desktop could be done using .desktop file copying, .desktop file or folder symlinking or .desktop file creating.
- anydesk.desktop file is copied: `cp /usr/share/applications/anydesk.desktop
/Desktop/
Downloads.desktop file which opens the Downloads directory by nautilus is created the next way:
In my case file properties changing is not required for .desktop file — it asks to execute it anyway:
A very easy and elegant way to create a shortcut to an file or folder is to create a symlink to the desktop. I have tested this on Lubuntu 20.04 LTS
To do this do the following:
Drag the file or folder from pcmanfm to your desktop
Then choose create symlink here
As I said before, this will probably only work on Lubuntu 20.04 (featuring the LXQt desktop)
In ubuntu 20.04 you need to make the file executable first, then you’ll find the «allow launching» option, anyway I can’t add it to the launcher, there’s simply no way to do it.
It’s ridiculous that there’s no easy way to do this. You need to search google and become crazy simply to add one icon. One icon. Great OS.
/.local/share/applications as well as
I’m very new to linux, but you all made this too difficult for 20.04. You were close to making it simple. Easy solution!
Click on Files or Show Applications and type Files, and open Files. Now in the upper right corner you have your 3 lines hamburger menu. Click that, and click Preferences, then click Behavior, then «Show Action to create symbolic links».
Now any time you right click on a file or folder, you can drag that file or folder with in «Files» to «Desktop» on the left side column. Once the symbolic link or shortcut is moved, you can rename it so it looks like the original source file or folder name.
This answer was meant to be a comment, but I don’t have enough reputation points.
A small addition on TheBuntuNewb’s answer that might be obvious to some but nearly drove me crazy: the name of the .desktop file has to match exactly the name of the executable file.
For example, I was trying to create a shortcut for pycharm named pycharm.desktop, but the Allow launch option was not showing up, until I renamed the file to pycharm.sh.desktop. After renaming everything worked smoothly.
I am assuming this is due to security concerns, but it’s worth pointing out to hopefully save someone’s time!
Why not just use gnome-extensions ?
Installation:
Usage:
\.local\share\applications (after using the AppImageLauncher)
For folder shortcut, first you need to enable the simlink creation under Files —> Preferences in the Behavior tab (Show action to create symbolic links) in order that the Create link menu can appear when you right click on a folder. You can do the same with SHIFT+CTRL+M but this key combination works only if the simlink creation is enabled as described above (otherwise useless), and you will also need to turn on Capslock before using the keys to trigger capital ‘M’.
For an average desktop user this is pain, and could be all enabled as default.
The easiest UI way:
Just open two windows of Files (file manager) and drag a file what you need, with holding down Alt key, as result you will get a familiar window dialog with Link Here
You can’t create link directly dragging file to Desktop, you should open Desktop via Files
Tested on Ubuntu 20.04
Thanx to «nobody» here on this forum, the command below solves this problem once you’ve created your starter on your desktop:
My exemple on Debian:
My exemple on Ubuntu:
Hope this helps.
To keep working with GUI one have to enable symbolic link creation in Nautilus by visiting its settings: Settings → Behavior → [x] Show action to create symbolic links and then user will be able to create symbolic links for executables, folders and files on the
But the most elegant way for average non-techinal user who is scared by the terminal — would be to not use GNOME Shell and install Unity or MATE DE instead with one of the two solutions below:
sudo apt-get install ubuntu-unity-desktop
sudo apt-get install ubuntu-mate-desktop^
then select one of these sessions on the login screen and as the result to forget this new GNOME Shell nightmare (the Desktop without DESKTOP is a pain, but not the real desktop).
More technical users who prefer traditional desktop with traditional habbits have to remove GNOME Shell completely and install other DE of their preference. I have a solution for such method which was tested on Ubuntu 20.04 LTS freshly installed VM.
Источник