From 22783bd0a08657f4bc0e819dcdd82118c2d60ff7 Mon Sep 17 00:00:00 2001 From: petronbot Date: Thu, 6 Aug 2015 10:42:36 +1000 Subject: [PATCH 1/3] Add an entry for find-and-replace --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 7f347fe..fe231e7 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,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 ---------------- From ca5d76c53576b57052fb829036414275092085ce Mon Sep 17 00:00:00 2001 From: petronbot Date: Thu, 6 Aug 2015 11:16:02 +1000 Subject: [PATCH 2/3] Add an entry for rsync --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index fe231e7..5bcc1fd 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,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` + From 556ce993534b51636594f60f3540031d04779cc6 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Wed, 26 Aug 2015 06:30:07 +0000 Subject: [PATCH 3/3] Added Gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5bcc1fd..31ddc19 100644 --- a/README.md +++ b/README.md @@ -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