You are on page 1of 16

Renfei Song's Blog about topics archives

Mac OS X Terminal 101


July 29, 2012 / 

Mac OS X Support Essentials Command Line


+

Mac OS X iOS 8 Spring Animation


Mac API
command-line September 26, 2014

CSS HTML checkbox

/ August 23, 2014

April 26, 2014


Finder command line
command line Mac SSH Ubuntu Apache, MySQL,
administrators sudo root PHP phpMyAdmin
command-line script
Terminal “ ” April 2, 2014

>console
Slick2D
StateBasedGame

March 2, 2014
Slick2D
Command Line
March 1, 2014

“ $”
Command Name Options Arguments Extras
Options - Options
ls -lA ls -l -A
Arguments Extras

Junk

michelle$ rm -R /Applications/Junk.app

man

man

man command-name ls
man ls

▲ ▼

/ Q
—— man -k

command line
command line
Finder

command line
iTunes itunes iTunes.app
Mac OS “ ” folders command line
“ ” directory UNIX

/ forward slash
/Users/michelle/Public/Drop Box
command line
Terminal command line home folder
Public/Drop Box html
“ .. ”
cd .. cd ../..
command line pwd ls
cd

1. pwd “print working directory”


2. ls “list directory contents”

3. cd “change directory”
home folder

[] ! $ & * ; | \

“ \ ” back slash cd Punlic/Drop\ Box/


cd "Public/Drop Box"

—— Finder Terminal

Tab Complete

Tab Complete command line


cd home folder cd P

tab home folder P

tab Terminal P Public

Pictures U tab Terminal Public/ Tab

complete /
/

~ tilde command line home folder


~/Public/Drop\ Box/
command line Finder
Finder command line
Finder
command line command line ls
. -a

michelle$ ls -la

-l
. ..
-a -A
command line root volume
command line
Volumes home folder
Time Machine Mac

bogon:~ renfei$ pwd


/Users/renfei
bogon:~ renfei$ cd /Volumes/
bogon:Volumes renfei$ pwd
/Volumes
bogon:Volumes renfei$ ls
Macintosh SSD      Time Machine
bogon:Volumes renfei$ cd Time\ Machine/
bogon:Time Machine renfei$ pwd
/Volumes/Time Machine

Command-Line

cat , less , which , file


find man

cat

cat “concatenate” Terminal cat


cat >>
cat ../textOne.txt >> textTwo.txt textOne.txt textTwo.txt
>> “Extras”

less

less
cat less
▲ ▼

Q V vi

which
which

le

file PNG
nd

find Spotlight
find
1. -x /Volumes
2. Soptlight mdfind

Wildcard Characters

Asterisk —— *.tiff ti

? Question mark —— b?ok book


brook
[] Square brackets —— [Dd]ocument
Document document doc[1-9] doc1, doc2, …, doc9
-r -R
-R ls

mkdir , cp , mv , rm , rmdir
vi

mkdir

“make diretory” mkdir


-p

cp
“copy” cp
-R
cp

mv

“move” mv mv
cp

rm

“remove” command-line rm
rm
srm

rmdir rm -R

rmdir “remove directory” CLI


rmdir rmdir
rmdir rm
-R

vi

“visual” vi
vi command line vi
vi Mac OS X nano
=_=
vi vi

less vi Terminal
“command ” vi vi
A

command
esc command Z
shift
enter
command :quit! return

Command-Line

su

su “substitute user identity”


su
who -m
Terminal exit

sudo

sudo

sudo “substitute user do” “super user


do” sudo root administrator
sudo root root
sudo Terminal
—— sudo

bogon:~ renfei$ cat secret.txt


cat: secret.txt: Permission denied
bogon:~ renfei$ sudo cat secret.txt
Password:
This is the contents of the secret.txt text file that the user account
renfei does not normally have access permissions to read. However,
because he is an administrative user, she can use the sudo command to
envoke root user access and read the contents of this file.

sudo sudo !!
sudo

sudo

Tab
completion sudo

sudo Shell

root
shell root sudo -s
Command-Line

open . Finder
Terminal

control + C

▲ ▼

history

control + L

   osx / terminal / unix

iOS 8 Spring Animation API

CSS HTML checkbox

Ubuntu Apache, MySQL, PHP phpMyAdmin

Slick2D StateBasedGame

Renfei Song's blog


Feed Except where otherwise noted, content on this site is licensed under a
GitHub Creative Commons Attribution-ShareAlike 4.0 International License.
Google Plus

You might also like