Show Menu

My Linux Cheat Sheet by



Print Working Directory, this shows the path you are currently working on
Change Directory, it can be a relative or absolute path (. is the directory itself and .. is the parent directory) Quick shotcuts cd goes to your home directory cd - goes to the last working directory cd ~user_­name goes to the home directory of that username
List contents of the directory
Determine file type, extensions in Linux does not necess­arily determine the purpose of the file. This command shows a brief descri­ption of the file's content.
Important facts:
- Filenames and directory names are case sensitive
- Filenames starting with an period (.) are hidden
- Do not use special characters other than period, dash and underscore

I/O Redire­ction

Output truncate redirect
Output append redirect
Error redirect
Sort lines of text
Print lines matching a pattern
Output the first specified part of a file
Output the last specified part of a file
Input, Output and errors are actually sent to special files called stdin, stdout and stderr. But by default, output and errors are linked to the screen and input is attached to the keyboard.

We can redirect where output goes and where input comes from, and using that with pipelines, we can perform complex tasks.


Operator: |

The difference of redire­ction and pipeline is that pipeline sends output as input for another command, while redire­ction does this to files.

General Commands

Clears the terminal screen
Display current time and date
Display a calendar of the current month
Manual for commands

Manipu­lating Files and Direct­ories

Copy files -a Copy all attributes of the original file -i Intera­ctive mode (ask for confir­mat­ion), default is not ask -r Recursive copy (required when copying entire direct­ories) -u Update, only overwrite if the copied files are newer
Move or rename files (original file ceases to exist)
Create direct­ories
Remove (delete) files and direct­ories -i Prompt for confir­mation, it does not ask for default -r Recursive remove files, required for directory -f Force, ignore nonexi­stent files and do not prompt

Important Direct­ories

Root directory, everything begins here
contains programs for the system to boot and run (commands in bash are here too)
Devices mounted
System config­uration files, and also shell scripts that run when the system boots. Important ones: /etc/­cro­ntab - definition for automated jobs /etc/­passwd - list of user accounts
Home direct­ories for users
Shared libraries
Removable media mount points
The home directory for the root user
Temporary files
Large directory tree, contains all the program files for regular users
Directory for data that changes frequently

Download the My Linux Cheat Sheet

1 Page

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

Like this cheat sheet? Check out our sponsors! is a collection of tools to make your writing better. More readable content means higher conversion rates and better reader engagement. Measure website and document readability, measure keyword density and more!

Click Here To Get Started!



No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          Vim NERDTree Cheat Sheet

          More Cheat Sheets by amicheletti