Skip to content

Instantly share code, notes, and snippets.

@emilefraser
Last active June 12, 2017 09:21
Show Gist options
  • Save emilefraser/675c2c8785577745071ca04cd52f17fc to your computer and use it in GitHub Desktop.
Save emilefraser/675c2c8785577745071ca04cd52f17fc to your computer and use it in GitHub Desktop.
[Bash Synstax & Commands] #shell #bash #run
# Installl wget (only curl on new mac) with brew
brew install wget
# Downloading options
## wget
### wget [OPTION]... [URL]...
wget http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz
## curl
### curl [options] [URL...]
curl -O http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz

Inccluded are the following:

  1. Syntax
  2. Files
  3. Internet
  4. Process
  5. Help
  6. Rights
# get files
ls
# get files incl rights
ls -l
# get all files incl hidden
ls -a
# get dirs and subdirs
ls -R
## current directors
pwd
## up or down dir
cd dirname
cd ..
## go to home
cd ~
cd $home
# ln
# alias
#OS X has long offered aliases, which let you create links to files, folders, and applications elsewhere in the system without having to duplicate them
ln -s file1/folder2 file2/folder2
# manual
# like vim, quit :q
man cp
# killall
# kill dock procs
killall dock
# defaults
#This command is often used in Terminal tips and tricks to tweak applications and system settings via their preference files.
defaults
# see rights of files
ls -l
# see chmod rights
# todo
# perform task as admin
sudo task...
chflags
# change flags on file
chmod
# change rights on file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment