Just right click on the application icon you want to remove and select "Remove from Favourites". Similarly right click on an application icon you want to add when the application is running and select "Add to Favourites".
If you really want to use Terminal to achieve your goal, see this.
Just right click on the application icon you want to remove and select "Remove from Favourites". Similarly right click on an application icon you want to add when the application is running and select "Add to Favourites".
If you really want to use Terminal to achieve your goal, see this.