Ubuntu – start Firefox in fullscreen mode from command line (Terminal)

Somehow I want to start firefox on my Ubuntu 12.04 LTS from command line in fullscreen mode. Firefox can be invoked from command line using command:

firefox

However, the command does not seem to have fullscreen option. This site uses xdotool to simulate that button F11 on the keyboard is pressed so the firefox goes on fullscreen. Hence, I a simple bash script helps achieving this task. Here is the script:

firefox http://localhost/abc.html & # one can use any url
xdotool key F11 # hit full screen

I save the above script as “firefoxfullscreen.sh” and I run it whenever I need it. Note that the script is relatively simple and it should be modified based on your purposes. One possibility is to add delay in between the two line as shown below:

firefox http://localhost/abc.html & # one can use any url
sleep 5
xdotool key F11 # hit full screen