Skip to content

Instantly share code, notes, and snippets.

@MarioRicalde
Created July 25, 2014 23:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarioRicalde/39b35077482ee3bdcc90 to your computer and use it in GitHub Desktop.
Save MarioRicalde/39b35077482ee3bdcc90 to your computer and use it in GitHub Desktop.
List of useful commands for day to day development.

Search Files

Search a file called httpd.conf in all directories:

find / -type f -name httpd.conf

Execute a command on all .conf files.

find / -type f -name httpd.conf -exec chmod 0700 {} \;

OSX: Search a file anywhere on your system:

mdfind httpd.conf

To Compress a File

tar -zcvf archive-name.tar.gz directory-name

Where:

-z: Compress archive using gzip program
-c: Create archive
-v: Verbose i.e display progress while creating archive
-f: Archive File name

To Uncompress a File

tar -xvf archive-name.tar.gz

Where:

-x : Extract a tar ball.
-v : Verbose output or show progress while extracting files.
-f : Specify an archive or a tarball filename.
-j : Decompress and extract the contents of the compressed archive created by bzip2 program (tar.bz2 extension).
-z : Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).

To Download a File (with multiple connections)

axel -an 10 http://path-to-file.com/file.tar.gz

Revert

Revert a merge:

git revert -m 1 <hash>

Get a Reverted Merge back into the branch:

git revert <hash_of_reverted_merge>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment