Skip to content

Instantly share code, notes, and snippets.

@rpowis
Created September 12, 2013 09:14
Show Gist options
  • Save rpowis/6534842 to your computer and use it in GitHub Desktop.
Save rpowis/6534842 to your computer and use it in GitHub Desktop.
Command line tricks and one-liners
#
# This is a list of useful commands and one-liners to make
# life on the command line easier
#
# Create complex directory structures
$ mkdir -p project/{lib/ext,bin,src,doc/{html,info,pdf},demo/stat/a}
# Option -C to unpack a .tar archive file to a location
$ tar xvf -C tmp/a/b/c newarc.tar.gz
# Use awk to find patterns in specific fields
$ ls -l | awk '$6 == "Dec"'
-rw-r--r-- 3 joe joe 5096 Dec 14 14:26 archive.tar
-rw-r--r-- 1 root root 238 Dec 03 08:19 README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment