The 8 Linux Commands I Use The Most - And What They Can Do For You

Trending 2 days ago
bluekeyboard555gettyimages-2236790511
Thanasis/Moment via Getty Images

Follow ZDNET: Add america arsenic a preferred source connected Google.


ZDNET's cardinal takeaways

  • The bid statement isn't required erstwhile utilizing Linux.
  • To genuinely maximize your Linux experience, you should still study it.
  • Some commands are much useful than others.

Before we begin, I want to beryllium clear: Using nan bid statement is not a request for utilizing Linux. I mention this because nan thought of typing commands tends to scare disconnected caller users, and my extremity -- for years -- has been to present group to nan open-source operating system.

After using Linux for complete 2 decades, I'm wholly comfortable pinch nan bid statement and thin to default to it for definite things. I do this because I find nan bid statement to beryllium much businesslike than utilizing a GUI. I tin time off a terminal model unfastened astatine each times and execute tasks without needing to return my hands disconnected nan keyboard.

Also: The first 8 Linux commands each caller personification should learn

So, yes, location are definite Linux commands that I tin count connected to usage each azygous day. Those commands thief maine do nan things I do, support my systems moving smoothly, and guarantee that I'm informed astir what's happening connected my machines.

Of course, everyone's computing acquisition is different, truthful what you request will apt disagree from nan commands I dangle on. That said, present are nan 8 Linux commands that are almost guaranteed to beryllium tally regular from my keyboard.

1. apical

I ever for illustration to cognize what's going connected nether nan hood, particularly if I consciousness arsenic if thing has gone awry. When that clip comes, top is my bid of choice. With top, I tin quickly find retired really galore strategy resources an app aliases bid is using. On apical of that, I tin spot nan PID (Process ID) associated pinch that bid aliases app and tin usage it to termination nan app, should it beryllium necessary. 

The logic I usage top alternatively than 1 of nan GUI apps is that I tin remote into a machine and uncover nan accusation from nan terminal. Top is fast, easy to use, and ne'er fails me.

To unfastened top, rumor nan pursuing command:

top

2. ssh

I could make a lawsuit for ssh being nan astir important bid connected nan list. Why? Consider this: Sometimes VirtualBox loses its mind, and a impermanent VM will commencement behaving severely capable to fastener up my system. When that happens, I tin usage ssh to entree nan system, usage top to find retired nan PID associated pinch nan VM, past termination nan VM pinch nan kill PID (where PID is nan process ID of nan VirtualBox guest) -- and I'm each set.

Also: My apical 5 password managers for Linux - and my favourite useful connected Windows and MacOS too

I often person to distant into different machines connected my web (or extracurricular of my network) to get definite things done (like updating a server). I besides usage scp (which is portion of ssh) to move files astir connected my network, so, yeah, ssh is beautiful important.

SSH is elemental to use. For example, if I want to distant into a server connected my LAN, I could rumor nan following:

ssh jack@192.168.1.100

3. sudo

This 1 is astir apt nan bid I tally astir often -- because I'm ever installing software, updating apps, managing processes and services, and doing each sorts of things that require admin privileges. If it weren't for sudo, I'd person to first alteration to nan guidelines user, which tin beryllium a information issue. With sudo, I summation impermanent admin privileges, tin tally a bid aliases app, and past cognize those privileges will beryllium automatically revoked aft a group period. Sudo was a very smart summation to Linux and continues to beryllium 1 of nan astir important commands I've tally to date.

Also: 5 obscure Linux distros you've astir apt ne'er heard of - but should decidedly try

Sudo is elemental to use. You simply adhd it to nan opening of immoderate bid you would tally that requires admin privileges for illustration so:

sudo apt instal upgrade -y

4. apt

Given really often I trial and reappraisal open-source package connected Debian/Ubuntu-based distributions, it should travel arsenic nary astonishment that apt is 1 of my astir often utilized commands. The apt package head simplifies nan process of managing applications and moreover fixing surgery installations (sudo apt instal -f has saved my hide connected respective occasions). Although nan GUI frontends for apt are outstanding, location are immoderate things they cannot do (such arsenic apt purge apt autoremove), which is why I often for illustration to negociate packages from nan bid line.

Apt is easy. For example, if you want to instal GIMP, you'd rumor nan pursuing command:

sudo apt instal gimp -y

5. wget

Wget is 1 of those commands that whitethorn not get utilized each day, but erstwhile it does get used, I recognize really important it is. When there's a record aliases book I request to download, and there's nary web browser-accessible nexus to use, wget can get nan occupation done. I usage wget regularly, particularly erstwhile installing server-based software, wherever nan operating strategy astir apt doesn't person a GUI to dangle on. With wget, it doesn't matter if there's a desktop situation aliases not; I tin still drawback immoderate I request to get nan occupation done.

Also: Ready to ditch Windows? I recovered a powerful mini PC that's optimized for Linux

Let's opportunity you want to download nan root for nan latest merchandise of GIMP. You tin do that with:

wget https://download.gimp.org/gimp/v2.10/gimp-2.10.0-RC1.tar.bz2

6. ps

The ps bid is basal if you want to beryllium capable to negociate moving processes and apps. One of nan main reasons why I usage nan ps bid is to way down accusation astir a process. For instance, I mightiness request to cognize accusation astir nan moving Zen Browser, and the top command doesn't springiness maine everything that I need. To find nan clip an app has been running, process IDs, and more, you tin usage nan ps bid and tube nan output to nan grep command (another important command) to spot only nan accusation related to Zen Browser. 

By utilizing this command, you don't person to usage apical and past effort to snag nan process ID arsenic it bounces astir successful nan listing arsenic different services and apps are tracked.

Also: 5 reasons why Zen is my caller favourite browser (RIP, Opera)

To usage nan ps bid pinch grep to find accusation astir Zen Browser, you could rumor nan command:

ps aux | grep zen

Comb done nan output and you should find nan accusation you're looking for.

7. tail

I often reappraisal log files to place and resoluteness issues pinch applications aliases services. Log files incorporate important accusation that tin thief you understand what's going connected pinch your system. However, conscionable utilizing nan less bid simply shows nan contents of nan full file. If a log record is lengthy and complicated, it whitethorn not beryllium helpful. Additionally, you whitethorn want to position entries successful a log record arsenic they are written. This is peculiarly adjuvant erstwhile troubleshooting an rumor and you request to position log entries arsenic they hap successful real-time.

The bid for this is 'tail', and it will greatly simplify your log viewing. 

Also: My apical 5 screen-recording apps for Linux - and they're each free

To usage tail successful nan measurement I picture above, you tally it successful conjunction pinch nan -f emblem (for follow). Let's opportunity you want to travel nan /var/log/syslog record and watch, successful real-time, arsenic entries are written. To do this, you'd tally nan command:

tail -f /var/log/syslog

By default, tail will show nan past 10 lines written to nan log file. If you request fewer, you could usage nan -n action for illustration so:

tail -f -n 1 /var/log/syslog

The supra bid would only database nan past introduction written to nan log file. This is simply a awesome measurement to support nan disorder of ample log entries astatine bay.

8. systemctl

Systemctl allows maine to power processes. Not only tin I commencement and extremity them, but I tin besides cheque to spot if they are moving aliases not. If a process has died, systemctl will study it. Then I tin besides usage it to thief troubleshoot why nan process stopped successful nan first spot (with journalctl - which is portion of systemctl), group nan default target (such arsenic GUI aliases terminal), disguise aliases unmask a service, alteration a work to commencement astatine boot, database portion files, and more. 

Also: My 5 favourite Linux matter editors (and why you should beryllium utilizing one)

Systemctl is simply a must-use to support a strategy moving well. Those caller to Linux astir apt won't request to fuss pinch systemctl at first, but eventually, you'll want to delve into nan specifications of this bid because it proves very handy.

The systemctl bid is simple. Say you want to commencement nan SSH daemon. This tin beryllium done with:

sudo systemctl commencement ssh

You tin besides cheque nan position of a work for illustration so:

systemctl position ssh

If you want to extremity a service, nan bid will look for illustration this:

sudo systemctl extremity ssh

As well, you tin restart a work pinch nan command:

sudo systemctl restart ssh

Finally, you mightiness instal a caller exertion that uses a service, but nan installation doesn't alteration nan service. When you alteration nan service, it intends nan work will ever commencement during nan OS footwear process. To alteration a service, rumor nan command:

sudo systemctl alteration ssh

To disable a work (preventing it from starting astatine boot), nan bid would be:

sudo systemctl disable ssh

You tin besides commencement and alteration a work astatine nan aforesaid time, for illustration so:

sudo systemctl alteration --now ssh

Get nan morning's apical stories successful your inbox each time pinch our Tech Update newsletter.

More