Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Linux-Commands-Cheat-Sheet
==========================

[![Join the chat at https://gitter.im/petronbot/Linux-Commands-Cheat-Sheet](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/petronbot/Linux-Commands-Cheat-Sheet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A compilation of some commonly used Linux commands for beginners (and those of us who often just forget :))

Files & Folders
Expand Down Expand Up @@ -33,6 +35,15 @@ Some common commands for navigating, moving, deleting & more!
##### Unzip a file or folder
tar -xvzf filename.tar.gz

##### Find and replace in a file
sed -i '' 's/old/new/g' file.ext

- `sed` = Stream EDitor
- `-i` = in-place (i.e. save back to original file)
- `old` = regex to replace
- `new` = text to replace it with
- `g` = global (i.e. replace all, not just first)


Transferring files
----------------
Expand All @@ -45,6 +56,12 @@ Securely (over SSH) and locally
##### Copy a folder from one location to another
cp -r /path/to/folder /path/to/dest

##### Sync two folders
rsync -a /path/to/folder /path/to/dest

- `-a` = Archive, syncs recursively and preserves sym links, special and device files, modification times, group, owner, and permissions
- Source folder can be a remote, e.g. `username@server.com:/path/to/folder`




Expand Down