Linux Commands

Linux users can interact with their machines through a wide assortment of different commands. Here, we have in-depth explanations of a variety of these commands.

Subscribe to Linux Commands
Get notified when new articles on Linux Commands are published.
  • 20 Results
    • Tutorial

      Package Management Basics: apt, yum, dnf, pkg

      Most modern Unix-like operating system, rely on a centralized package management system for finding and installing software. This guide serves as a quick reference for the fundamentals of finding, installing, and upgr...
      1 month agoBy Brennen BearnesLinux CommandsGetting StartedSystem ToolsLinux Basics
    • Question

      How to pass environment variables to a Docker container?

      I’ve seen this being asked quite a bit, so I’ve decided to write this answer outlining a few ways how to pass environment variables to a Docker container. Hope that this is helpful! If you have any questions post the ...
      Accepted Answer: Set environment variable with the -e flag The -e flag can be used to pass environment variables to a Docker container. For example, if you want to pass the environment variable MY_ENV_VAR to the container, you can do ...
      1 answer2 months agoBy Bobby IlievContainerDockerLinux BasicsLinux Commands
    • Tutorial

      How To Use Top, Netstat, Du, & Other Tools to Monitor Server Resources

      Monitoring a server’s resources is an important task for every administrator. There are many command line tools made for this purpose. This guide will cover some of the more popular utilities for monitoring your VPS.
      2 months agoBy Justin Ellingwood, Alex GarnettInteractiveMonitoringLinux Commands
    • Tutorial

      How To Use ps, kill, and nice to Manage Processes in Linux

      Process management is an essential skill when using any computer system. This is especially true when administrating a server environment. This article will introduce some powerful tools that can be used to manage pro...
      2 months agoBy Alex GarnettLinux CommandsLinux BasicsSystem Tools
    • Tutorial

      How To Build Go Executables for Multiple Platforms on Ubuntu 16.04

      The Go programming language comes with a rich toolchain that makes obtaining packages and building executables incredibly easy. One of Go’s most powerful features is the ability to cross-build executables for any Go-s...
      2 months agoBy Marko MudrinićApplicationsMiscellaneousOpen SourceLinux CommandsUbuntu
    • Tutorial

      How to Add and Delete Users on Ubuntu 20.04

      Introduction Adding and removing users on a Linux system is one of the most important system administration tasks to familiarize yourself with. When you create a new system, you are often only given access to the root...
      2 months agoBy Jamon CamissoLinux BasicsLinux CommandsUbuntu 20.04Interactive
    • Question

      Can I configure Droplet to automatically restart python app service when I update *.py file?

      I am running a Python app on my droplet, with Flask, Gunicorn, Nginx talking to PostgreSQL hosted cluster, all on DO platform. I set it up by following this tutorial:
      1 answer2 months agoBy BluemontFlaskLinux CommandsPythonUbuntu 20.04
    • Question

      Unexpected result from answering a Linux prompt on my Droplet

      As I was following the tutorial on “How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 20.04” I was prompted to install various packages, such as Certbot for setting up my SSL certificate. When I did th...
      2 answers3 months agoBy BluemontDigitalOcean DropletsLinux CommandsUbuntu 20.04
    • Question

      Pull file from remote windows machine

      I have a digital ocean droplet, I also have my local windows machine. Currently, I transfer files using psftp and a Batch file that i schedule using windows task scheduler to copy files FROM my windows machine INTO my...
      1 answer3 months agoBy PumaDigitalOcean DropletsLinux CommandsUbuntuUbuntu 20.04
    • Question

      How to change the root password with the cloud-init program on CentOS 7

      As I was following through the introduction to Cloud-Config Scripting,I noticed there were no examples of tasks that I usually use on Linux machines. Is it possible to change the root password with cloud-init?
      Accepted Answer: Hi there, Yes, this should be doable with the following: #cloud-config chpasswd: list: | root:<^>your_secure_password_here<^> expire: False Hope that this helps!Best,Bobby
      1 answer4 months agoBy georgesjeandenisLinux BasicsLinux CommandsCentOSCloud ComputingInitial Server Setup
    • Tutorial

      How to Add and Delete Users on Ubuntu 18.04

      Learning how to manage users effectively is an essential skill for any Linux system administrator. In this guide, we will discuss how to add and delete users and assign sudo privileges on an Ubuntu 18.04 server.
      4 months agoBy Jamon CamissoInteractiveLinux BasicsLinux CommandsUbuntu 18.04
    • Question

      How to send signals through the web console (terminal)

      i wanted to send an signal to interrupt which is normally ctrl+c, but nothing happened. I tried typing ^c, ^C, and ^[c (option+c generates this one), but nothing worked…
      Accepted Answer: Hi @rahil627 , You are correct, it’s ctrl+c . Having said this, sometimes it takes some time for the Droplet to receive the signal and stop the job it’s executing, it’s often experienced when it’s a job that requests ...
      1 answer5 months agoBy ra the wolfLinux Commands
    • Question


      I want to restrict certain commands to certain users that are sudoers, for example: john ALL=ALL,!/usr/bin/apt-get #john won’t be able to run apt-get My question comes when john can use cp, mv or ln to copy and change...
      1 answer5 months agoBy Sergio Sánchez MartínezLinux CommandsConfiguration ManagementTeam Management
    • Question

      NGINX rewrite script

      Hi, Sometimes I’ve to add hundreds of redirects to my NGINX server block. Such a script could definitely make my work easier. I didn’t find ready-made solutions. I’m writing a script that gets addresses from a file an...
      Accepted Answer: Hi there, There are probably multiple ways to do it, but I would personally use a for loop to loop through each of the lines fo the file and then use printf to construct the redirect rule as follows: #!/bin/bash if [ ...
      1 answer5 months agoBy MichalGizaLinux CommandsNginx
    • Question

      kali linux ssh permission denied(public key, password) problem

      Hello,I tried every possible method and tutorial that exists in the internet but ssh still wants me to connect the commands with public,key and password For example i try command ip-copy-id -i user@ip -addr...
      1 answer6 months agoBy akselseriLinux BasicsLinux CommandsUbuntu
    • Tutorial

      How To Use Find and Locate to Search for Files on Linux

      Finding files is a very common task on any operating system. The Linux “find” and “locate” commands can both be used to search for files on the filesystem. This guide will cover how to use these two tools to craft spe...
      6 months agoBy Justin EllingwoodLinux BasicsSystem ToolsLinux CommandsInteractive
    • Tutorial

      How To Use Bash History Commands and Expansions on a Linux VPS

      As you administer servers, you will begin to spend a lot of time on the command line. Most likely, you will be using the bash shell. The bash shell includes a lot of commands and expansion capabilities to take advanta...
      6 months agoBy Justin EllingwoodLinux BasicsLinux CommandsInteractive
    • Tutorial

      Command Line Basics: Symbolic Links

      Learn how to create symbolic links between files and directories from the command-line using the ln command.
      6 months agoBy joshtronicLinux BasicsLinux CommandsInteractive
    • Question

      How can I invoke poweroff from a script/process?

      I’d like for my droplet image to do the following: Boot Ubuntu 20 Start a process (using services.d or whatever) When the process finishes, invoke poweroff For the droplet to truly power off I haven’t been able to mak...
      1 answer6 months agoBy joriswDigitalOcean DropletsLinux Commands
    • Question

      Bash script with cat and $1

      Hello,I am writing a script which, among other things, generates Nginx configuration. Unfortunately, I ran into a problem. In Nginx config, I need to type $1. I use the following method for this: cat > /etc/nginx/site...
      Accepted Answer: Hello, What you could do is just use a backtick to escape the dollar sign: cat > /etc/nginx/sites-available/website <<EOL ... rewrite ^/api/?(.*)$ /web/api.php?url=<^>\<^>$1 last; ... EOL Hope that this helpsRegards,B...
      1 answer7 months agoBy MichalGizaLinux Commands