These 10 Linux Commands Showed Me How Much Better Life Is Off Windows

6 days ago 3

When I archetypal switched to Linux from Windows, I was intimidated by the terminal. The achromatic surface with its blinking cursor seemed archaic compared to Windows' polished GUI. Why would anyone take to benignant commands erstwhile you could conscionable click buttons? Oh, however incorrect I was.

The terminal isn't conscionable an alternate interface—it's a superpower that makes your beingness easier. Although you request to larn thing caller astatine first, but, erstwhile you recognize the basics, you tin execute galore analyzable tasks easy utilizing conscionable a fewer commands.

After utilizing Linux for respective years, I've travel crossed aggregate commands that wholly changed my workflow and showed maine wherefore beingness is amended without Windows. These aren't conscionable commands; they're capabilities that Windows either lacks wholly oregon implements poorly done clunky interfaces and third-party solutions. Here are a fewer of them!

10 grep – Find Anything Instantly

Unlike Windows' file-content search, which tin beryllium dilatory and constricted to the GUI, the Linux grep instrumentality streams results to your terminal arsenic they're found. You tin usage grep for elemental searches wrong files, recursive searches, signifier matching, oregon adjacent tube its output to different commands.

A terminal unfastened  connected  Ubuntu

Related

How to Use the grep Command connected Linux

More accusation than you tin shingle a instrumentality at.

You conscionable request to springiness it a signifier (like a connection oregon phrase) and archer it wherever to look (a file, aggregate files, oregon adjacent the output of different command), similar this:

grep "important note" ~/Documents/*.txt
Finding phrases successful  the database  of files successful  my Documents folder.

With this elemental command, I tin hunt done each substance record successful my Document's folder for the operation "important note." The results look successful milliseconds, showing the filename and the enactment containing my hunt term.

grep isn't conscionable for files—you tin besides tube it into different commands to filter output. For example, if you privation to database each Chrome processes, you tin run:

ps aux | grep "chrome"

With grep, you don't request to unfastened each papers individually oregon usage the sluggish hunt relation that seems to scale everything but what you're really looking for.

9 find – Locating Files With Precision

Don't confuse find with grep, which is large for uncovering substance wrong files. While you could harvester grep and ls to find definite files, the find bid is specifically designed to find files and directories themselves. Unlike Windows Search, which sometimes misses hidden oregon strategy files, find lets you specify precisely what you want—by name, size, modification date, oregon adjacent content.

The Ubuntu desktop.

Related

How to Use the find Command successful Linux

Use find with xargs and exec to instrumentality your Linux record searches to the adjacent level.

Let's find each log files older than 30 days with this:

find /var/log -name "*.log" -type f -mtime +30
Getting older log files utilizing find   command.

On Windows, this would necessitate sorting by day successful File Explorer and manually checking each folder. With find, it's a azygous command. But find doesn't conscionable find files—it tin besides execute commands connected them. To delete each those aged log files, tally this:

find /var/log -name "*.log" -type f -mtime +30 -delete

This level of granular power implicit record strategy operations simply isn't built into the modular Windows interface.

8 APT, YUM/DNF, Pacman – Easy Software Installation

To instal immoderate Windows software, you typically request to hunt online, download an installer, click done a wizard, diminution the bundled toolbar, hold for installation, make a desktop shortcut, and yet motorboat your program. On Linux, you tin bash each of this utilizing bundle managers with a azygous command.

A laptop moving  Linux sitting connected  a table.

Related

Linux bundle managers similar APT (Debian oregon Ubuntu), DNF (Fedora), oregon Pacman (Arch) marque the process incredibly simple. For example, to instal GIMP (an representation editor) connected a Debian-based strategy similar Ubuntu, you conscionable run:

sudo apt instal gimp

That's it. One bid to instal GIMP on with each its dependencies—no wizards, nary unwanted software, nary reboots. Not lone that, you tin besides update each your installed bundle astatine erstwhile utilizing this:

sudo apt update && sudo apt upgrade

This azygous bid checks for updates to each installed programme and applies them successful 1 go.

7 Piping – The Power of Combination

The tube relation (|) allows you to instrumentality the output of 1 bid and provender it straight arsenic input to another. This elemental conception unlocks immense powerfulness by letting you harvester small, single-purpose utilities into analyzable workflows.

img_5c94224b1cfd7

Related

How to Use Pipes connected Linux

Many hands marque airy work. Many commands do, too. Use Linux pipes to drawstring them unneurotic into customized powerhouses.

For example, retrieve ls -l, which lists files with details.

ls -l
Listing files utilizing ls command.

What if the supra database is huge, oregon you lone privation to instrumentality the full fig of files? You tin bash that by utilizing the tube relation "|" with the wc command.

ls -l | wc -l
Listing and counting files successful  Linux terminal.

This calculates and prints conscionable the fig of lines. Other than that, you tin besides find each the processes moving connected your system (ps aux) and past filter for lone those related to your web server (apache).

ps aux | grep apache

This quality to concatenation commands unneurotic similar gathering blocks is incredibly almighty and forms the ground of galore businesslike scripting and automation tasks. Windows PowerShell has adopted piping, but it's not arsenic cosmopolitan oregon seamlessly integrated arsenic it is successful Linux, wherever this doctrine is cardinal to the system's design.

6 htop oregon apical – Real-Time Process Monitoring

Windows Task Manager gives you a snapshot of moving processes, CPU usage, representation usage, and more. It's functional but often feels a spot static, and getting detailed, real-time accusation astir what your strategy is doing tin beryllium challenging.

Konsole Terminal unfastened  connected  the Kubuntu Focus Ir14 Linux laptop.

Related

Linux offers command-line tools for monitoring processes—most notably top and its much user-friendly version, htop. When you tally htop, you get a dynamic, real-time presumption of your system's enactment straight successful your terminal.

Terminal model   moving  htop, showing CPU, memory, and process   usage successful  existent  clip  connected  an Ubuntu system.

You tin spot CPU and representation usage per process, benignant by assorted criteria (CPU usage, representation usage, process ID), termination rogue processes, and adjacent presumption a histrion operation showing parent-child relationships betwixt processes.

Related

Color Bars successful htop - What Do They Mean?

Ever wondered what each the red, green, orange, aqua and acheronian bluish bars mean successful htop? Even if you are not acquainted with htop, this nonfiction volition present you to the large Linux task manager and it's colour key.

5 Cron – Scheduled Automated Backups

Setting up automated tasks connected Windows typically involves utilizing the Task Scheduler. It's a graphical instrumentality that is susceptible and wide utilized but tin sometimes consciousness little streamlined for script-heavy oregon precocious automation. If you privation to tally a circumstantial bid oregon publication astatine a circumstantial clip regular oregon hourly, Linux offers a antithetic attack with Cron.

Clock and Time

Related

What is simply a Cron Job, and How Do You Use Them?

The cron utility is utilized for moving scripts and commands astatine regular intervals, and astatine circumstantial times and dates.

Cron is simply a time-based occupation scheduler successful Linux and Unix-like systems. By editing your crontab file, you tin specify commands to tally and erstwhile to tally them, utilizing a straightforward five-field syntax: minute, hour, time of the month, month, and time of the week.

Want to tally a backup publication located astatine "/home/user/backup.sh" each nighttime astatine 2:00 AM? After moving this command:

crontab -e

Add the pursuing enactment to your crontab:

0 2 * * * /home/user/backup.sh

Don't get maine wrong—while some tools are powerful, neither instrumentality is universally better. I similar Cron due to the fact that it is lightweight, text-based, and integrates seamlessly with the bid enactment and version-control systems. In contrast, Windows Task Scheduler relies connected a GUI/XML configuration, has much overhead, and tin endure from session- and permission-related quirks.

4 rename oregon loops – Bulk Renaming

Renaming aggregate files connected Windows tin consciousness tedious and limited—even with modern File Explorer, you're restricted to elemental sequential renames (select files, F2) oregon indispensable edifice to PowerShell oregon third‑party tools for thing much advanced.

In contrast, Linux provides almighty built‑in command‑line options that fto you rename hundreds of files instantly utilizing either the rename inferior oregon elemental ammunition loops.

For example, to adhd a prefix to each JPG files, usage this loop successful bash oregon zsh:

for record successful *.JPG; bash mv "$file" "TripToItaly_$file"; done
The Terminal unfastened  connected  Linux.

Related

How to Use the rename Command connected Linux

Upgrade your Linux record renaming powers and instrumentality rename for a spin.

Or you tin usage the rename bid to alteration the extensions of each TXT files to MD utilizing the Perl‑based rename (Debian/Ubuntu syntax):

rename 's/\.txt$/\.md/' *.txt

On distributions with the util‑linux rename (common connected CentOS, Fedora, Arch), use:

rename .txt .md *.txt

These commands tally successful an O(n) loop implicit your files—no clicking, nary other software, conscionable fast, flexible, scriptable renaming that scales.

3 curl oregon wget – Command-Line Downloads

The curl and wget commands are invaluable for scripting, automating downloads, fetching information for processing, and moving connected servers wherever a graphical browser isn't available. What if you request to download a record programmatically, arsenic portion of a script, oregon from a server that requires authentication—or adjacent download hundreds of files from a list? With wget and curl, you get fine-grained power implicit the download process—something a web browser simply can't match.

Linux laptop showing a bash prompt

Related

For example, to download a record from a circumstantial website, usage this:

wget https://example.com/path/to/file.zip

curl is adjacent much versatile, supporting a wider scope of protocols and options. It's large for interacting with web APIs, sending data, and performing analyzable transfers:

curl -O https://example.com/another/file.tar.gz

The -O saves the record with its archetypal name.

Several linux terminals.

Related

2 Alias – Creating Your Own Shortcuts

We each person tasks we execute repeatedly. Typing the aforesaid agelong bid implicit and implicit is tedious and prone to typos. On Windows, creating system-wide command-line shortcuts isn't straightforward for the mean user.

Example of alias moving  connected  the Linux terminal.

Related

Why You Should Be Using Aliases successful the Linux Terminal

Even if you're alert of them, marque definite you're utilizing them to their afloat extent.

Linux shells (like Bash oregon Zsh) fto you make customized shortcuts called aliases. An alias is simply a short, memorable bid that the ammunition replaces with a longer 1 erstwhile you benignant it.

For example, alternatively of typing ls -lha each time, you tin create:

alias ll='ls -lha'

Now, typing ll runs the afloat command. You tin adhd aliases to your shell's configuration record (like .bashrc oregon .zshrc) truthful they're disposable each clip you unfastened a terminal.

You tin make aliases for anything—connecting to servers, moving scripts, oregon launching your favourite apps. For example:

alias update="sudo apt update && sudo apt upgrade -y"

Add this to your .bashrc file and tally update successful the terminal to update each your software.

1 tmux – Multiple Screens

tmux is simply a terminal instrumentality that lets you divided 1 model into aggregate panes. You tin tally antithetic commands successful each pane—editing code, watching logs, oregon moving tests—and everything keeps moving adjacent if you disconnect.

A blank Linux Terminal, similar  you'd spot    if you opened a caller   tmux window.

Related

How to Use tmux connected Linux (and Why It's Better Than Screen)

Is the Linux tmux bid truly amended than screen? We gave it changeable to find out.

You tin instal tmux utilizing your bundle manager, similar connected Debian-based systems, usage this:

sudo apt instal tmux
tmux multiplexer model   with horizontal and vertical pane

Windows besides supports tabs and aggregate windows, but you tin not detach a session, log out, past reattach later. However, if you tally tmux wrong WSL connected Windows, you summation the aforesaid detach-and-reattach capableness you'd person connected a autochthonal Linux system.


These commands are indispensable tools that person greatly improved my Linux experience. Learning adjacent a fewer of them is simply a fantastic spot to start. You tin besides check retired these overlooked commands that tin unlock adjacent greater powerfulness and flexibility.

Read Entire Article