How do I run FileZilla by name from a terminal?
The question is this. Downloading a program for linux (Ubuntu 18.04
), for example, FileZilla. There's a binary to run. How do I make it so that you can run it in the terminal in the background and write only the name:
filezilla
Running with the addition of &
at the end of the command does not produce the desired result.
UPD 1 Made a run on the command
- Moved the downloaded FileZilla3 to the directory
/bin/FileZilla3
- Output to the variable
$PATH
and add to it:export PATH="$PATH:/bin/FileZilla3/bin/filezilla"
; - I also corrected the file
/home/user-name/.bashrc
(so as not to enter the above command every time the system starts):export PATH="$PATH:/bin/FileZilla3/bin/filezilla"
; - Also FileZilla3 asked to install the module canberra-gtk-module (how to install);
I'm almost satisfied. FileZilla3 is now launched from anywhere by the command filezilla
. But I do not want to see this when running the program with the command filezilla &
:
Reading locale option from /home/user-name/.config/filezilla/filezilla.xml
wxD-Bus: Signal from /org/freedesktop/DBus, member NameAcquired
wxD-Bus: Reply with serial 2
wxD-Bus: Reply to RegisterClient, our object path is /org/gnome/SessionManager/Client32
And I do not want to enter nohup filezilla &
, since the information nohup: ввод игнорируется, вывод добавляется в 'nohup.out'
is automatically displayed and the process hangs in the terminal (after pressing Enter exits the process). And I want to just enter filezilla
and then control was transferred back to the terminal (you could enter new commands).
There is also a problem when closing the program (from the GUI):
WxD-Bus: Unregistered
Only after pressing CTRL+C the process terminates with the output of the message:
[2]- Завершён filezilla
[3]+ Завершён nohup filezilla
UPD 2 Made an alias (how to create an alias), as suggested by @Total Pusher
UPD 3 Can be run without creating
alias
by pressing the ALT key combination+F2 and there are no notifications (for me, this is not a bad solution), but I will still createalias
to write onlyfz
. Thank you @andreymal
1 answers
The main method
nohup filezilla &
Option for zsh
If an alternative to bash is used in the form of zsh
or Oh My Zsh
(my choice), then:
filezilla &!
Forgot to unpin immediately
If you forgot to unpin, and the program is already running in this way:
filezilla
Then switch to the terminal and click Ctrl + Z
- the program will pause, and we will get access to the command line and see:
[1] + 32696 suspended filezilla
Next, enter bg
- the program will start running in the background, in the the terminal will be
[1] + 32696 continued filezilla
Now enter:
disown %1
The program will "detach" from the terminal process, and the terminal can be closed.