Linux is so flexible that you often can achieve the same results in several different ways. What sets sysadmins apart is how we use this flexibility to achieve the desired outcome. One of the joys we all share is our daily interaction with Linux terminals and the command line. Evidently, terminals and command lines play a significant role in almost every Linux admin’s life.
Commands can get tricky at times and really frustrating when you have the right skills, but your brain starts thinking faster than what your keyboard and mouse can do for you.
What can you do to simplify your interaction with Linux so that you can accomplish much more every day? The most straightforward, yet practical solution is utilizing shortcuts. Shortcuts can significantly improve your skills and save you several days every year, according to recent studies. So now you may be asking yourself, “What are the most popular and frequently-used Linux shortcuts out there?”
Well, ask no more! In this article, I share my top 10 terminal shortcuts that I believe are useful to the broadest range of the sysadmin community. They are a vital part of my life and allow me to save time and focus better on what I enjoy doing: Building systems. I also provide a quick tip at the end to help you master any Linux shortcuts.
But wait, what are shortcuts?
Shortcuts are a key or combination of keys that provide quick access to a specific task or command. Almost everyone uses computer shortcuts in some form or fashion, but they are particularly critical for Linux sysadmins.
Just a note, most of these tricks assume you're using a Bash shell. They may be similar in other shells, but be aware there could be subtle differences.
1. Tab
Tab is my ultimate friend - it never lets me down. It is the handiest shortcut and time saver ever developed. It autocompletes commands, file names, or directory names for you. Simply start typing a command, file name, or directory name, and then press the Tab key. The system will either complete the string or display all available options to you.
2. Ctrl+C
Ctrl+C is a well-known shortcut that I use all the time. It cleanly aborts most programs by sending the SIGINT signal to the program that I want to interrupt and abort. Most programs correctly catch it and exit cleanly. If the program does not specify how to handle SIGINT, the underlying processes are then self-terminated. Yes, it's safe to use.
3. Ctrl+R/O/G
I find this combination (reverse-i-search) very useful when searching through my command history. I can bring up commands that I used previously, navigate through them, and repeat the command I need. This is very helpful with long and chained commands.
- Ctrl+R: Recall the last command matching the characters you provide.
- Ctrl+R (again): Navigate through the matching commands.
- Ctrl+O: Send the command back to your terminal or select Enter to execute the command from the search mode.
- Ctrl+G: Leave the history search mode without running a command.
4. Ctrl+L
This shortcut is equivalent to the clear
command. It clears your terminal screen.
5. Ctrl+D
This shortcut will effectively log you out of any terminal and close it, or get you back to the original user when used after su
or sudo
commands. It sends an EOF (End-of-file) marker to bash. Bash exits when it receives this marker. This shortcut is similar to running the exit
command.
[ Free download: Advanced Linux commands cheat sheet. ]
6. Ctrl+Alt+D
This shortcut will minimize all terminals/windows and show your desktop. Repeat it to revert your windows back in the same order.
7. Ctrl+U
This shortcut erases everything from the current cursor position to the beginning of the line. I find this useful when I mistype a command or see a syntax error and prefer to start over. It's a very handy shortcut.
8. Ctrl+Z
This shortcut is useful if you need to get the terminal back while working on something. It sends the SIGTSTP signal to the foreground process. For example, you are working in a text editor and need to break out to find some data. You can use this shortcut to suspend and send the editor to the background, do your other task, and then run fg
to get back into your application.
9. Ctrl+A
Move the cursor to the beginning of the line. Very handy when you need that little flag added to the beginning of your 200 characters chained-command. I use this instead of the arrow keys to save time.
10. Ctrl+E
This shortcut does the opposite of Ctrl+A. It moves the cursor to the end of the line. I always use the Ctrl+A and Ctrl+E shortcuts to quickly move my cursor around the current line while typing long or chained commands.
Bonus tip
You now have my top 10 list and a good idea of how shortcuts can improve your sysadmin skills and overall productivity. Now, how are you going to memorize them?
One of the best ways I found to learn Linux shortcuts is to choose a couple of shortcuts, write them on a Post-it note, and stick it to my screen. I keep the Post-it there until I have learned the shortcuts by heart. I then change to another note that contains new shortcuts.
Wrap up
It takes time to develop quality Linux skills. I know I didn’t have them all when I started with Linux two decades ago. Learning this handful of shortcuts will help shine as a Linux pro and earn you serious bragging rights in the Linux community.
[ Download now: A sysadmin's guide to Bash scripting. ]
Sobre el autor
Waseem is a senior HPC engineer at ION with 15+ years of multinational experience in the Linux & IT industry. He has a proven track record of achievements, starting from low-level to complex system support, migrations of mission-critical systems, leading teams, to mega-scale datacenter deployments; spawning tens of thousands of servers, hundreds of petabytes and thousands of users.
Waseem’s journey with Linux started more than two decades ago when he automated the migration of his college computer lab from Linux 2.4 to 2.6, and the migration of MIS students from KDE to GNOME for his Bachelors' thesis.
Reach out or follow him on LinkedIn:
Navegar por canal
Automatización
Las últimas novedades en la automatización de la TI para los equipos, la tecnología y los entornos
Inteligencia artificial
Descubra las actualizaciones en las plataformas que permiten a los clientes ejecutar cargas de trabajo de inteligecia artificial en cualquier lugar
Nube híbrida abierta
Vea como construimos un futuro flexible con la nube híbrida
Seguridad
Vea las últimas novedades sobre cómo reducimos los riesgos en entornos y tecnologías
Edge computing
Conozca las actualizaciones en las plataformas que simplifican las operaciones en el edge
Infraestructura
Vea las últimas novedades sobre la plataforma Linux empresarial líder en el mundo
Aplicaciones
Conozca nuestras soluciones para abordar los desafíos más complejos de las aplicaciones
Programas originales
Vea historias divertidas de creadores y líderes en tecnología empresarial
Productos
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Servicios de nube
- Ver todos los productos
Herramientas
- Training y Certificación
- Mi cuenta
- Soporte al cliente
- Recursos para desarrolladores
- Busque un partner
- Red Hat Ecosystem Catalog
- Calculador de valor Red Hat
- Documentación
Realice pruebas, compras y ventas
Comunicarse
- Comuníquese con la oficina de ventas
- Comuníquese con el servicio al cliente
- Comuníquese con Red Hat Training
- Redes sociales
Acerca de Red Hat
Somos el proveedor líder a nivel mundial de soluciones empresariales de código abierto, incluyendo Linux, cloud, contenedores y Kubernetes. Ofrecemos soluciones reforzadas, las cuales permiten que las empresas trabajen en distintas plataformas y entornos con facilidad, desde el centro de datos principal hasta el extremo de la red.
Seleccionar idioma
Red Hat legal and privacy links
- Acerca de Red Hat
- Oportunidades de empleo
- Eventos
- Sedes
- Póngase en contacto con Red Hat
- Blog de Red Hat
- Diversidad, igualdad e inclusión
- Cool Stuff Store
- Red Hat Summit