Cheatography
https://cheatography.com
Useful Linux Commands for Webdevelopers
Directory / Filescd Directoryname | Change Directory | ls | List Items in Current Directory | ls -lha | List Items with extra Info in Current Directory | mkdir Directoryname | 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 subdirectorys | cp Filename (Copied Filename) | Copy an File | cp -R Directoryname (Copied Directoryname) | Copy an Directory |
Backupstar -czvf Backupname.tgz . | Backup complete Content from Current Directory | tar -czvf --exclude="ExcludeData" 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 Editorvim Filename | create/edit File | vi 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 + S this will crash Putty
Expert User Stuffgrep -rnw -e "Searchword" * | Search in Current Directory | scp -C ssh-username@ssh-host:/path/to/file . | Download File over SSH from an Server | wget url | Download File over http/https | alias new-commandname="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
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets