Home

Linux All-in-One For Dummies Cheat Sheet

|
|  Updated:  
2022-11-01 20:05:10
Fedora Core Linux 5 Multipack For Dummies
Explore Book
Buy On Amazon
Linux can fulfill almost any need you have for the operating system on a desktop computer, but you must be able to tell it what you want to do in a way that it understands. You need to know common commands and how to access the help pages.

Common Linux commands

Command Description
cat [filename] Display the file’s contents to the standard output device (usually your monitor).
cd /directorypath Change to directory.
chmod [options] mode filename Change a file’s permissions.
chown [options] filename Change who owns a file.
clear Clear a command-line screen/window for a fresh start.
cp [options] source destination Copy files and directories.
date [options] Display or set the system date and time.
df [options] Display used and available disk space.
du [options] Show how much space each file takes up.
file [options] filename Determine what type of data is within a file.
find [pathname] [expression] Search for files matching a provided pattern.
grep [options] pattern [filename] Search files or output for a particular pattern.
kill [options] pid Stop a process. If the process refuses to stop, use kill -9 pid.
less [options] [filename] View the contents of a file one page at a time.
ln [options] source [destination] Create a shortcut.
locate filename Search for the specified filename.
lpr [options] Send a print job.
ls [options] List directory contents.
man [command] Display the help information for the specified command.
mkdir [options] directory Create a new directory.
mv [options] source destination Rename or move file(s) or directories.
passwd [name [password]] Change the password or allow (for the system administrator) to change any password.
ps [options] Display a snapshot of the currently running processes.
pwd Display the pathname for the current directory.
rm [options] directory Remove (delete) file(s) and/or directories.
rmdir [options] directory Delete empty directories.
ssh [options] user@machine Remotely log in to another Linux machine, over the network. Leave an ssh session by typing exit.
su [options] [user [arguments]] Switch to another user account.
tail [options] [filename] Display the last n lines of a file (the default is 10).
tar [options] filename Store and extract files from a tarball (.tar) or a compressed tarball (.tar.gz or .tgz).
top Displays the resources being used on your system. Press Q to exit.
touch filename Create an empty file with the specified name.
who [options] Display who is logged on.

To access your CDs/DVDs and USB sticks:

  • If you’re in the graphical user interface (GUI), the media should be automatically detected.
  • On the command line, look in the /media directory. You may need to use mount /media/cdrom, /media/dvdrom, or some other variant.

To remove your CDs/DVDs and USB sticks:

  • In the GNOME 3 desktop, right-click the media’s icon and select Eject from the context menu. If you’re using the KDE Plasma desktop, select the Device Notifier icon in the Panel, and then select the CD or USB icon to eject.
  • On the command line, type umount /media/cdrom, where you should change cdrom to whatever you had to use to mount the item.

Accessing Linux help pages

To find help, try the following commands:

  • man -k [keyword]: Search a database for commands that involve the keyword. Can also be used as apropos [keyword].
  • info [command]: Display a file’s help information in an alternate format.
  • man [command]: Display a file’s help information.
  • whatis [command]: Display a short blurb about the command.

You can also check the following documentation:

  • openSUSE: The openSUSE documentation (https://doc.opensuse.org) provides a complete reference guide to both the openSUSE environment and the GNOME 3 desktop environment. There’s also a user forum (https://forums.opensuse.org) where users can post and answer specific questions about using openSUSE.
  • Rocky Linux: The Rocky Linux documentation web page (https://docs.rockylinux.org) provides access to guides (short how-to documentation), books (longer-format documentation), labs (step-by-step work-throughs of processes), and gemstones (very short how-to documents).
  • Ubuntu: The official Ubuntu documentation (https://help.ubuntu.com) provides basic information on how to get started with most common desktop tasks. Just look for the topic area you’re interested in and follow the thread. Ubuntu also has a wiki (https://wiki.ubuntu.com), where Ubuntu users can contribute their own guides and tutorials.

About This Article

This article is from the book: 

About the book author:

Richard Blum has more than 30 years of experience as a systems administrator and programmer. He teaches online courses in PHP, JavaScript, HTML5, and CSS3 programming, and authored the latest edition of Linux For Dummies.