Skip to content

Instantly share code, notes, and snippets.

@tibbon
Created June 17, 2013 02:08
Show Gist options
  • Save tibbon/5794257 to your computer and use it in GitHub Desktop.
Save tibbon/5794257 to your computer and use it in GitHub Desktop.
Linux Bash Examples
Macbook Pro:bash_example tibbon$ ls
hello_world.rb lib
Macbook Pro:bash_example tibbon$ ls -al
total 0
drwxr-xr-x 4 tibbon staff 136 Jun 16 22:05 .
drwxr-xr-x 151 tibbon staff 5134 Jun 16 22:04 ..
-rw-r--r-- 1 tibbon staff 0 Jun 16 22:05 hello_world.rb
drwxr-xr-x 3 tibbon staff 102 Jun 16 22:05 lib
Macbook Pro:bash_example tibbon$ cd lib
Macbook Pro:lib tibbon$ ls
example.rb
Macbook Pro:lib tibbon$ cd ..
Macbook Pro:bash_example tibbon$ pwd
/Users/tibbon/Code/bash_example
Macbook Pro:bash_example tibbon$ mkdir test
Macbook Pro:bash_example tibbon$ ls
hello_world.rb lib test
Macbook Pro:bash_example tibbon$ cd test
Macbook Pro:test tibbon$ ls -al
total 0
drwxr-xr-x 2 tibbon staff 68 Jun 16 22:06 .
drwxr-xr-x 5 tibbon staff 170 Jun 16 22:06 ..
Macbook Pro:test tibbon$ cd ..
Macbook Pro:bash_example tibbon$ cp hello_world.rb hello_you.rb
Macbook Pro:bash_example tibbon$ ls
hello_world.rb hello_you.rb lib test
Macbook Pro:bash_example tibbon$ mv hell
hello_world.rb hello_you.rb
Macbook Pro:bash_example tibbon$ mv hello_you.rb new_you.rb
Macbook Pro:bash_example tibbon$ ls
hello_world.rb lib new_you.rb test
Macbook Pro:bash_example tibbon$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment