Cheat Sheet

Linux Commands Cheat Sheet

Burr Sutter and Bob Reselman
September 6, 2022
LInux Commands cheat sheet cover 2022

Get the cheat sheet

About

The Linux operating system offers a multitude of commands, which can be overwhelming for beginners.  This cheat sheet helps you get familiar with over 30 basic Linux command-line executables frequently used by developers. You’ll find easy-to-learn shortcuts and code examples to help you find your way around the Linux command line.

With the Linux Commands Cheat Sheet, you’ll learn basic commands for:

  • Application and process management:
    • which
    • yum
  • Console and output management, working with data sent to stdout or displayed in a terminal window:
    • cat
    • clear
    • echo
    • top
  • Creating and exporting environment variables:
    • env
    • export
    • printenv
    • source
  • Working with files and directories:
    •  cd
    • cp
    • find
    • grep
    • ls
    • mkdir
    • more
    • mv
    • pwd
    • rm
    • tar
  • Accessing command-line help documentation:
    • man
  • Working with networks on and from a Linux computer:
    • curl
    • ip
    • netstat
    • ssh
    • wget
  • Process management:
    • &&
    • kill
    • ps
  • System control:
    • poweroff
    • restart
  • User management:
    • whoami

With Red Hat Developer cheat sheets, you get essential information right at your fingertips so you can work faster and smarter. Easily learn new technologies and coding concepts and quickly find the answers you need.

Excerpt

find

sudo find <starting/directory> -name <file/directory name>

Finds a file or directory by name.

Example:

The following command finds a file named hostname starting from the root ( / ) directory of the computer’s filesystem. Note that the command starts with sudo in order to access files restricted to the root user:

$ sudo find / -name hostname

/proc/sys/kernel/hostname

/etc/hostname

/var/lib/selinux/targeted/active/modules/100/hostname

/usr/bin/hostname

/usr/lib64/gettext/hostname

/usr/share/licenses/hostname

/usr/share/doc/hostname

/usr/share/bash-completion/completions/hostname

/usr/share/selinux/targeted/default/active/modules/100/hostname

/usr/libexec/hostname

grep

grep <search_expression> <input>

$ less -N ~/.bashrc

Comments