I have firefox already running on my system, and now in minimised state. What I want is to close the current tab running in firefox. How can I do this by simply using commands in terminal?
Ubuntu – Close current tab firefox using terminal
command linefirefox
Related Question
- Ubuntu – How to open an URL from command line to Firefox and “switch to tab”
- Ubuntu – Why can’t I get Firefox to close
- Ubuntu – Undo close tab (Ctrl+Shift+T) not working in Firefox
- Firefox Terminal – How to Close New Firefox Window from Terminal
- command line Firefox URL – How to Get Current Active Tab
- Ubuntu – Opening a new tab in Firefox through the terminal
- Command-Line – Command to Switch to the Last Terminal Tab in GNOME Terminal
Best Answer
To keep
Firefox
minimized after closing its current tab (according to OP, see the comment) use the following commands in a terminal,How it works
To know more about these see
man xdotool
andman wmctrl
Alias for above command
You can make an alias for the above commands, say the alias name be
cfct
( Close Firefox Current Tab) in~/.bashrc
or better in~/.bash_aliases
from a terminal as,If you don't have
~/.bash_aliases
replace~/.bash_aliases
in the above commands with~/.bashrc
Usage
open a terminal and enter
And it will close Firefox’s current tab instantaneously.
Note: You need to have
wmctrl
andxdotool
installed in your system. To install them use,