If you are used to the convenient 'start command’ at the command prompt in Microsoft Windows, you are likely to be a bit disappointed not to have the same functionality on Linux. But it does not have to be like that!
What is it start?
If you have used Microsoft Windows for a long time, you have probably found some shortcuts that simplify your work. One of those super handy shortcuts is to use the start command at command prompt in Windows.
Start is extremely versatile. You can write start .
to open a directory browser window right at the location where you are at the command prompt (the current directory). You can also write start notepad
, and it will open the notepad app, and so on. You can even do things like start mypdf.pdf
, And it will open your default type assigned app to open PDF files!! Practical.
Then move on to Linux and hope that the same great functionality is there. But it's not like that:
Start is not a default command in Linux. Even so, Linux, much more than Microsoft Windows, enables us to adjust our systems the way we like them, even almost to infinity. Linux offers control where Microsoft doesn't. Then, let's implement our own start.
Reimplementación start en Linux!
Reimplementación start on Linux it's easier than you think. Here are two methods. Es probable que el primero funcione de manera más universal en varias distribuciones de Linux, mientras que el segundo está más centrado en Linux Mint y Ubuntu.
El primero utiliza el xdg-open
. Se necesitan dos comandos para volver a poner en práctica start
:
sudo apt install xdg-utils echo "alias start="xdg-open"" >> ~/.bashrc
Note: si utiliza Fedora, RedHat o Centos en lugar de una distribución basada en Debian, you can use sudo yum install xdg-utils
en lugar de la primera línea.
El primer comando instalará el xdg-utils
package, lo que nos posibilita utilizar el comando xdg-open
. It is likely that xdg-utils
ya está instalado en su sistema, and trying to do it again will not harm the operating system in any way.
The second command adds an alias to our personal Bash startup script (the hidden file ~/.bashrc
) in which xdg-open
it is called whenever start
runs on command line. Note that you can also write xdg-open
, but I prefer the shorter and more familiar start
.
After making these changes, exit your shell and reopen it. You should now be able to use start
on, for all intents and purposes, the same way you would in Microsoft Windows:
There may be some minor differences in operation; as an example, if you run a command like start text.txt
where such a file exists, a file manager with that file highlighted (you need an extra double click) can open instead of open assigned app.
There are slight differences between xdg-utils
Y exo-utils
(Described below) in this way, and it depends on your underlying desktop window manager and in addition to your file type association settings.
Test what works best for you and set the correct file type associations in your operating system to maximize minor differences. You can do this by right-clicking on a file and selecting options similar to Open with> Other app> choose an app and set it as the default.. Additionally there may be a file type configuration screen available on your Linux distribution.
Note that the first time you run commands this way, You may be presented with a dialog similar to the following:
At, just select your favorite file manager. For more information on how to do this and what kinds of alternatives are available here, you might want to check out our post Sharing File Managers in Mint 20
Si de alguna manera tuvo problemas, o está usando Linux Mint o Ubuntu y le gustaría probar otra factible solución, puede probar esta solución alternativa que utiliza exo-utils
, un paquete originalmente adjunto al xcfe
administrador de ventanas de escritorio, pero además se puede usar en, o junto con, otros administradores de ventanas.
Para nuestra segunda solución, se necesitan dos comandos para volver a poner en práctica start
:
sudo apt-get install exo-utils echo "alias start="exo-open --launch FileManager"" >> ~/.bashrc
El primer comando instala el exo-utils
, similar to our installation of xdg-utils
. The second command will add the line alias start="exo-open --launch FileManager"
in order to ~/.bashrc
again similar to our first solution. The command required here is a bit more complex, but things work exactly the same way.
Ending
Having start
available on Linux, especially when you tend to use terminal command line a lot, makes the combination between text-based terminal and desktop windows manager definitely better.
Once I use the answer for a while, the different alternatives for using it will become more apparent and the efficiency of using your computer and the skills of the operator will improve significantly.
Enjoy!