Show Menu
Cheatography

PM Linux Commands old Cheat Sheet (DRAFT) by

Useful Linux Commands for Webdevelopers

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Directory / Files

cd Direct­oryname
Change Directory
ls
List Items in Current Directory
ls -lha
List Items with extra Info in Current Directory
mkdir Direct­oryname
Make Directory in Current Directory
mv Filename (new Location or Filename)
Move or Rename File or Folder
mv -R Filename (new Location or Filename)
Move or Rename File or Folder including subdir­ectorys
cp Filename (Copied Filename)
Copy an File
cp -R Direct­oryname (Copied Direct­ory­name)
Copy an Directory

Backups

tar -czvf Backupname.tgz .
Backup complete Content from Current Directory
tar -czvf --excl­ude­="Exclud­eData" Backupname.tgz .
Backup Content from Current Directory with Excludes
tar -xzvf Backupname.tgz
Extract Backup in Current Directory
mysqldump -u User -pPassword DBName -h Host > Backupname.sql
Backup­/Export Database to Current Directory
mysql -u User -pPassword DBName -h Host < Backupname.sql
Import Backup from Current Directory to Database
 

VI / VIM Editor

vim Filename
create­/edit File
In Editor Command Mode
:w
To Save the File
:q
To Close the Editor
:wq or :x
To Save and Close the Editor
? Word
To Search in the File
Press i
To switch to Insert Mode
In Editor Insert Mode
Press ESC
To exit the Insert Mode and
go to Command Mode
Important Don't use Stuff like CTRL + C this will crash Putty

Expert Use Stuff

grep -rnw -e "Searchword" *
Search in Current Directory
scp -C ssh-us­ername@ssh-host:/path/­to/file .
Download File over SSH from an Server
wget url
Download File over http/https
alias new-co­mma­ndname="Command"
Create an Alias for the Current Session
clear
Clears the Terminal
history
Shows the History of Commands
Important If you want an Alias working every time you loging in you need to add it in the .bashrc file

Expert Use Stuff

grep -rnw -e "Searchword" *
Search in Current Directory
scp -C ssh-us­ername@ssh-host:/path/­to/file .
Download File over SSH from an Server
Important If you want an Alias working every time you loging in you need to add it in the .bashrc file

Expert Use Stuff

grep -rnw -e "Searchword" *
Search in Current Directory
scp -C ssh-us­ername@ssh-host:/path/­to/file .
Download File over SSH from an Server
wget url
Download File over http/https
alias new-co­mma­ndname="Command"
Create an Alias for the Current Session
clear