Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
46 Cards in this Set
- Front
- Back
pwd
|
print working directory
"directory" is just a folder /Users/Lisa |
|
hostname
|
my computer's network name
Lisas-MacBook-Air.local |
|
mkdir
|
make directory
"path" = directories inside directories mkdir -p i/like/icecream = makes the entire path |
|
cd
|
change directory
can only cd down the path, not up "cd .." to move up; "cd ../../.." to move up x3 "cd temp/stuff/things" to cd x3 just "cd" --> home directory cd ~ = home directory, e.g. cd ~/folder/ |
|
ls
|
list directory = shows contents of that directory
ls -l = long listing ls -a = listing including hidden files ls -lh = long listing with human readable file sizes ls - R --> shows ALL contents, not just 1 lvl |
|
rmdir
|
remove directory
rmdir -p i/like/icecream = removes entire path rm -rf newplace = removes directory and files w/i |
|
pushd
|
push directory
--if in temp & pushd i/like, saves spot @ temp, goes to like --pushd (with nothing more) will then toggle b/t temp and like --popd sends you back to temp & unsaves the spot |
|
popd
|
pop directory
--if in temp & pushd i/like, saves spot @ temp, goes to like --pushd (with nothing more) will then toggle b/t temp and like --popd sends you back to temp & unsaves the spot |
|
touch |
creates an empty file changes time on file |
|
cp
|
copy a file or directory
--cp iamcool.txt neat.txt = copies into same directory --cp neat.txt something/ = copies neat.txt into something directory --cp -r something newplace = creates copy of something directory named newplace --overwrites files that already exist |
|
mv
|
move a file or directory
--seems more like renaming --mv awesome.txt uncool.txt = "moves" file to new path --mv uncool.txt something/ = moves file to something directory |
|
less
|
"page" through a file
--spacebar goes to next "page" --w goes to previous "page" --"q" to quit less --once you quit the text WON'T show in terminal |
|
more |
Output content delivered in screensize chunks "page" through a file, spacebar goes to next "page" --"q" to quit more --once you quit the text WILL show in terminal |
|
cat
|
print the whole file
--doesn't "page" --cat > somefile.txt = lets you type the text of the file directly in terminal, CTRL-D (on its own line) to end |
|
rm |
remove a file --rm uncool.txt --rm iamcool.txt neat.txt thefourthfile.txt--rm something/awesome.txt --rmdir something --rm -r [dir] = remove directory & contents --rm -i [file] = remove w/confirmation --rm -f [file] = force removal w/o confirmation |
|
| |
pipe takes the output from the command on the left, and "pipes" it to the command on the right |
|
< |
will take and send the input from the file on the right to the program on the left tell command to read content from a file |
|
> |
takes the output of the command on the left, then writes it to the file on the right --cat ex13.txt > ex15.txt = creates ex15.txt file with text from ex13.txt > [file] = Push output to file, keep in mind it will get overwritten |
|
>> |
takes the output of the command on the left, then appends it to the file on the right >> [file] = append output to existing file |
|
* |
anything -wherever *, the shell will build a list w/files that match the non-* part -ls *.txt = anything ending in .txt |
|
find
|
find files
--find . -name "*.txt" -print | less = find all .txt files --"Hey find, start here (.) then find files named *.txt and print them". --"find STARTDIR -name WILDCARD -print" --find temp2 -name "*.txt" -print | less |
|
grep
|
find things inside files
$ cat > newfile.txt ---This is a new file. $ cat > oldfile.txt ---This is a old file. $ grep new *.txt ---newfile.txt:This is a new file. $ grep old *.txt ---oldfile.txt:This is a old file. $ grep file *.txt ---newfile.txt:This is a new file. ---oldfile.txt:This is a old file. |
|
-i |
ignore case --grep -i new *.txt |
|
man [command]
|
read manual page for [command]
|
|
apropos
|
searches through man pages to find what man page is appropriate
|
|
env
|
look at your environment
|
|
echo
|
print some arguments
echo $TESTING 1 2 3 |
|
export
|
export/set a new environment variable
$ export TESTING="1 2 3" $ echo $TESTING 1 2 3 |
|
unset
|
Unsave a variable
|
|
exit
|
exit the shell
|
|
xargs
|
execute arguments
|
|
sudo
|
DANGER! become super user root DANGER!
Run command with the security privileges of the superuser (Super User DO) |
|
chmod
|
change permission modifiers
|
|
chown
|
change ownership
|
|
CTRL-C |
abort command |
|
open [file]
|
Opens a file ( as if you double clicked it )
|
|
top
|
Displays active processes. Press q to quit
|
|
q
|
Exit
|
|
clear
|
Clear screen
|
|
history n
|
Shows the stuff typed – add a number to limit the last n items
|
|
ctrl-r
|
Interactively search through previously typed commands
|
|
![value]
|
Execute the last command typed that starts with ‘value’
|
|
!!
|
Execute the last command typed
|
|
[command] -h [command] -- help [command] help |
Offers help |
|
reset |
Resets the terminal display |
|
whatis [command] |
Gives a one-line description of [command] |