11 Must‑Know Linux Terminal Tricks to Supercharge Your Workflow
This guide compiles eleven powerful Linux terminal shortcuts and commands—including cursor editing keys, sudo shortcuts, background job control, nohup, at scheduling, man page tweaks, htop, ranger, shutdown cancellation, process killing, REISUB, and youtube‑dl—designed to boost productivity and streamline everyday command‑line tasks.
Essential cursor‑editing shortcuts
Quickly manipulate text on the command line with combinations such as CTRL+U (cut before cursor), CTRL+K (cut to end of line), CTRL+Y (paste), CTRL+E (move to end), CTRL+A (move to start), ALT+F / ALT+B (jump word forward/backward), ALT+Backspace (delete previous word), CTRL+W (cut next word), and Shift+Insert (paste from clipboard).
Fixing a typo with sudo !!
If a command fails with “permission denied”, you can prepend sudo to the previous command by typing sudo !!. For example, after apt-get install ranger fails, sudo !! re‑executes it as sudo apt-get install ranger.
Pausing and resuming jobs
Use CTRL+Z to suspend the foreground process, then bring it back with fg. This is handy when editing a file with nano and you need to run another command without exiting the editor.
Running commands after logout with nohup
When connected via SSH, prepend nohup to a long‑running command to keep it alive after the session ends, e.g.,
nohup wget http://mirror.is.co.za/mirrors/linuxmint.com/iso//stable/17.1/linuxmint-17.1-cinnamon-64bit.iso &.
Scheduling one‑off tasks with at
Use the at utility to run a command at a specific time. Example: at 10:38 PM Fri followed by cowsay 'hello' and CTRL+D will execute cowsay 'hello' at the given time.
Customising man pages
Improve readability by setting environment variables, e.g., export PAGER=most (after installing most), export MANWIDTH=80 to control line length, and man -H to open pages in a web browser when $BROWSER is defined.
Process inspection with htop
Install htop to get an interactive, colour‑rich view of running processes, similar to a graphical task manager, with keyboard shortcuts for sorting and the ability to kill processes directly.
File‑system navigation using ranger
After installing ranger, launch it with the ranger command. It presents a two‑pane view; left/right arrows move between directories, and its own man page explains additional shortcuts.
Cancelling a pending shutdown
Abort a scheduled shutdown with shutdown -c. If the shutdown has already begun, you can try pkill shutdown to stop the process.
Killing hung processes quickly
Identify a stuck process with ps -ef or htop, then terminate it. For GUI applications, the xkill command lets you click the offending window to kill it.
Emergency reboot with REISUB
If the entire system hangs, hold Alt and SysRq and press the keys R E I S U B in order to safely reboot without using the power button.
Downloading YouTube videos
Install youtube-dl from your package manager and download a video with youtube-dl <url-to-video>. Copy the video URL from the YouTube share button and paste it into the terminal (e.g., using Shift+Insert).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
