- How to open a Linux terminal window
- More Linux resources
- The shell
- The terminal emulator
- Opening the Linux terminal window
- Option 1
- Option 2
- Wrapping up
- 5 Ways to Open a Terminal Console Window Using Ubuntu
- Use these shortcuts to quickly perform common tasks
- Open a Linux Terminal Using Ctrl+Alt+T
- Search Using the Ubuntu Dash
- Navigate the GNOME App Launcher
- Use the Run Command
- Use Ctrl+Alt+A Function Key
- How do I open a terminal? [duplicate]
- 2 Answers 2
- How can I open a new terminal window from a cli command and print «Hello World»
- 2 Answers 2
How to open a Linux terminal window
Image by Pixabay
More Linux resources
Say you are new to Linux world and just installed Linux desktop and now you would like to fire up terminal window and start issuing commands, but wait you don’t know how to access a terminal window in Linux, in this article I will walk you through how to open a Linux terminal window and set up a keyboard shortcut for easier access.
Before I begin, allow me to explain the basic differences between a shell and a terminal emulator.
The shell
The shell is a command-line interface program that takes commands from the user as an input, processes the command, and prints out the output to the display. In most Linux systems, you will find bash (Bourne Again SHell) installed and is the default, Bash is an enhanced version of Unix shell program sh (shell). Apart from bash, there are other shell programs that can be installed on Linux machines such as ksh, zsh, and csh.
The terminal emulator
Simply put, a Terminal Emulator is a program that allows users to interact with shell in the graphical user interface (GUI) environment.
Some familiar terminal emulators you might find in Linux distros are:
Opening the Linux terminal window
I am using a Centos 8 Machine with the Gnome Desktop Environment. I’m going to show you two different ways to open a Linux terminal window.
Option 1
Gnome desktop environment makes easy access of application, in order to access the terminal window, press the super key (aka Windows key) and you should see Terminal application listed on the left-hand side application pane if you don’t see it listed on here simple start searching for “Terminal” in the search area.
You should see a Terminal Emulator application
Option 2
The other way (my favorite) is to open the terminal window is with a keyboard shortcut. Who doesn’t like to have a keyboard shortcut? Keyboard shortcuts make it easier to launch apps.
You can create a keyboard shortcut to open a terminal window, create a new shortcut, press the super key and search for “keyboard” or “shortcut” and launch it.
Click on “+” option at the end of the list to create a new keyboard shortcut.
Provide the required information, Like Name of the shortcut, command. You can name this anything you would like to, I named it “Open Terminal Window”, the command, in this case, is “gnome-terminal” since gnome-terminal is installed on centos and RHEL machines. If you have other terminal emulators such as “konsole” provide that command in this field. In the next article, I will show you how to install other Linux terminal emulators.
Click on set shortcut button to set a new keyboard short cut, this is where you register key combination to launch the terminal window.
I used CTRL + ALT + T, you can use any combination, but remember this key combination should be unique and not being used by other keyboard shortcuts.
Finally, click on Add to register this keyboard shortcut and you’re all set to use the new terminal window shortcut you created.
Wrapping up
Whether you choose to create a keyboard shortcut to launch a terminal window or to simply launch it from Applications, it’s simple to open the Linux terminal window in Linux. The process is similar to other desktop environments. For myself, I like the luxury of using keyboard shortcuts. In a future article, I will show you how to install additional terminal emulators onto your Linux system. Until then, enjoy practicing at your new-found graphical command line.
Want to try out Red Hat Enterprise Linux? Download it now for free.
Источник
5 Ways to Open a Terminal Console Window Using Ubuntu
Use these shortcuts to quickly perform common tasks
It’s possible to do most of the things you want to do in Linux without using the Linux terminal. However, there are many good reasons to learn how to use it. The Linux terminal provides access to the Linux commands as well as command-line applications that often provide more features than desktop applications. Another reason to use the terminal is that online help guides that solve problems with a Linux environment contain Linux terminal commands.
People use an array of desktop environments as well as Linux distributions. Hence, the terminal commands are usually the same or are easier to narrow down than writing full graphical instructions for each combination.
When using Ubuntu, it is easier to install software using the command line than it is to use the graphical software tools available. The apt-get command provides access to every package in the Ubuntu repositories, whereas the graphical tool is often lacking.
Open a Linux Terminal Using Ctrl+Alt+T
The easiest way to open a terminal is to use the Ctrl+Alt+T key combination. When you hold these three keys at the same time, a terminal window opens.
Search Using the Ubuntu Dash
If you prefer a graphical approach, select either the Activities launcher in the upper-left corner of the desktop or the Show Applications icon in the lower-left corner.
In the search box, enter term. As you type, the terminal icon appears. You will likely see an option for the default GNOME terminal at the top. Below, other terminal emulators that are available to install are listed.
To use the default one for your system, select the GNOME one at the top. It’s called Terminal.
Navigate the GNOME App Launcher
Another way to open a terminal window is to navigate the GNOME applications menu. Select Show Applications in the lower-left corner of the desktop. Then, select All at the bottom of the screen, if it isn’t highlighted, scroll down, and select Utilities.
There are several system tools under Utilities. The Terminal is one of those utilities. Select it to open it.
Use the Run Command
Another relatively quick way to open a terminal is to use the run command option. To open the run command window, press Alt+F2. To open the terminal, type gnome-terminal into the command window, then press Enter on the keyboard.
You must enter gnome-terminal because that is the full name of the terminal application.
You can also type xterm for the xterm application or uxterm for the uxterm application if those are installed on your system.
Use Ctrl+Alt+A Function Key
The methods illustrated so far open a terminal emulator in the graphical environment. To switch to a terminal that isn’t linked to the current graphical session, usually when installing certain graphics drivers or doing anything that messes with your graphical setup, press Ctrl+Alt+F3.
You will need to log in because you are starting a new session.
You can use F4 through F10 to create more sessions.
To get back to the graphical desktop, press Ctrl+Alt+F2.
Источник
How do I open a terminal? [duplicate]
I just got ubuntu running on my computer and now I am ready to write a program. but I can’t figure out how to open a command terminal. I guess I don’t know where to find which version I am running either. Any help would be appreciated. Thank you.
2 Answers 2
- Open the Dash by clicking the Ubuntu icon in the upper-left, type «terminal», and select the Terminal application from the results that appear.
- Hit the keyboard shortcut Ctrl — Alt + T .
There are a couple of methods:
- If you’re running Unity: open the dash, type terminal, hit Return .
- If you’re on the old style menus, Applications → Accessories → Terminal.
- Control + Alt + T .
- Alt + F2 , gnome-terminal , Return .
- For a TTY: Control + Alt + F1..7 .
If you’re using Ubuntu variants, you might need to substitute gnome-terminal for xfce4-terminal , konsole or if you’ve gone off-piste, terminator (my fav) or if you’re running out of options, xterm . There are others — many, many others — but I doubt you’ll ever find them on a *buntu default install.
The TTYs are your last, best hope if you desperately need some form of terminal. Just be aware that they’re not conscious of the graphical environment so if you want to launch something graphical from one, you’ll need to run export DISPLAY=:0 first. Or adapt that if you’re running more than one X display.
Источник
How can I open a new terminal window from a cli command and print «Hello World»
I’ve been playing with the gnome-terminal command for some minor automations, and I keep running into the same issue. The goal is to open a new window in the same directory as the current window, and execute a simple command (i.e. echo, cd, or similar). This command seems to work fine to open the new window in the same directory:
However, when I add an execution to it, it fails:
I receive a message saying that -e is deprecated and I should use — so I swapped to
However I now receive this error:
Failed to execute child process “echo «test»” (No such file or directory)
Does anyone know why this is happening?
Exact System Specs: Ubuntu 18.04, GNOME Terminal 3.32.1 using VTE 0.56.2 +GNUTLS
The exact deprecation message is:
# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
2 Answers 2
Ah. I see. The two messages are actually distinct.
I think this means that you should use -x , instead — everything on the command line after -x is considered to be part of the command to be executed.
This is a convention used in command line programs. The two dashes indicate that anything that comes afterward, regardless of whether or not it has a dash, is not a command line option. It’s useful in conjunction with -x , because you may have stuff that you don’t want parsed as one of the options to gnome-terminal — rather they’re command line arguments to be run inside the terminal.
I think an example would probably make this clearer.
This opens a gnome terminal. Inside the terminal we’re running grep, and excluding any line that contains the string «42». If we had not used — , gnome-terminal would see -v as a command line argument of gnome-terminal , and probably thrown a warning saying that -v is not a valid argument to gnome-terminal.
Ok, so both -x and -c are deprecated. You can execute commands without any flags. It does require using — to terminate all other options. so I was pretty much wrong about everything that I said. The rationale was solid, just wrong.
will open a new terminal, and launch nano inside the terminal.
Things get tricky when you try
It runs, but it exits so fast that you don’t see anything other than a flash on the screen.
Note that there is also an open bug about the deprecation of -c :
To clarify the issues in the OP, 2 Points:
the (unexplained) error indicates that the «command» is
i.e. it is trying to run the program stored in the file named echo «test» (being the single argument after the —). The correct syntax would be
but (as stated by Barton Chittenden) that then results in the terminal window appearing and disappearing (after executing the echo) almost instantly (probably faster than the screen refresh rate, giving the appearance that nothing happened). It needs some delay. So try
(I know this is wrong, wait for the analysis)
but this just seems to do nothing for longer. Reason:- ; is a reserved symbol (control operator) and terminates the argument list for gnome-terminal . The sleep 5 is a separate command executed after the (do nothing) gnome-terminal . Trying to quote the ; is ineffective:
This is syntactically valid if what you want is to display test ; sleep 5 in a nanosecond window. No, the problem here is that we are trying to execute a command LIST not a command (single executable). So the answer is:
Execute a general command line in a new window using «sh -c»:
P.S. For the pedants, I know that spaces around ; and the » around (the single word) test are unnecessary. Also, I have used the generic sh to represent whichever version is in use on the target system (and assumed that -c works as in Bourne shell). Further, the shell variable ( DIR in the example) is redundant, just use —working-directory=$(pwd) , unless you want to use the value again within the subsequent command (line). In fact, in my testing, gnome-terminal starts in the current directory of the invoking process, so —working-directory is almost certainly redundant here. Finally, the question wanted to print «Hello World», so the (fully and minimally) correct answer (with added delay) is:
P.P.S. While testing the (deprecated) -e and -x options, the following was noted (V3.28.2):
-x has the same effect as — , further argument processing is still inhibited. This possibly explains the «odd» error
as it is trying to execute the command — . (Didn’t get this exact error in my testing, just the standard «—» No such file or directory .)
Источник