Section 1

Preview this deck

du

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (256)

Section 1

(50 cards)

du

Front

display a list of directories and the disk space in blocks (512 chars) they occupy

Back

tr -s "p"

Front

make all instances of pppppppp or pppppp or pp simply p

Back

diff file1 file2

Front

compare two files line by line

Back

cd

Front

go to a different directory

Back

cut -d ':' -f3 filename

Front

cut out the third field that is separated by a colon :

Back

cut -c2

Front

cut out the second character

Back

chown

Front

change the owner of the file

Back

cd ..

Front

go to the parent directory

Back

tail -5 fileName

Front

return last 5 lines of file named 'fileName'

Back

head -c12 anotherFile

Front

return the first 12 characters of a file named 'anotherFile'

Back

[:alpha:]

Front

represents letters with translate tr

Back

ln curFile linkedFile

Front

hard link a file

Back

file ../*

Front

show all the files in the parent directory and their types

Back

dirname

Front

removes the file's base name and returns the RELATIVE path

Back

What is Unix

Front

A multi-user, multi-tasking Operating system

Back

cut -c-5

Front

cut first five characters

Back

find -name someFile

Front

get the relative path from the current directory of someFile

Back

cat

Front

concatenate files - print to standart output

Back

sort filename

Front

sort a file

Back

wc -l

Front

get the number of lines of a file

Back

echo -n

Front

write to screen...omit newline chars

Back

wc -m

Front

get the number of characters of a file (**includes carriage return on echo) i.e subtract ONE!

Back

find someFile

Front

list someFile and the path of all of its subfiles starting from someFile/

Back

grep -w

Front

search for a word in a file

Back

tr -d [z] someFile

Front

delete all the z's from a file

Back

cp

Front

copy files AND directories

Back

grep -c stuff filename

Front

get the count of the number of lines of a file containing 'stuff'

Back

basename

Front

removes the path and returns just the name of a file

Back

tr -d [k-m] someFile

Front

delete all k,l and m's from given file

Back

grep

Front

search for a string in a file

Back

tr ":" " "

Front

change colons to spaces in a file

Back

wc -c

Front

get the number of bytes of a file (**includes carriage return on echo) i.e. subtract ONE!

Back

[:digit:]

Front

represents numbers with translate tr

Back

cmp file1 file2

Front

compare two files byte by byte (returns first position where files differ)

Back

grep -v

Front

search for the inverse of what you want in a file

Back

cut -c 3-7

Front

cut third to 7th characters

Back

grep -i

Front

search for a string in a file case insensitive

Back

ln -s curFile softFile

Front

soft link a file

Back

wc -w

Front

get the number of words of a file

Back

head -5 someFile

Front

return the first five lines of file named 'someFile'

Back

wc someFile

Front

display the 1) number of Lines 2) number of words 3) number of bytes and the 4) name of a file

Back

sort -r filename

Front

sort a file in reverse order

Back

head

Front

retrieves beginning 10 lines of a file

Back

tr [:upper:] [:lower:]

Front

change all uppercase letters to lowercase in a file

Back

chmod

Front

change permissions

Back

sort -t ":" -k4 someFile

Front

Like cut, but uses a delimiter to get fields 4,5,6...... which are ALL used to sort the file

Back

u o g a +x -x +r -r +w -w

Front

users others group all - change execute, read and write privilages

Back

find anyFile

Front

find 'anyFile' in the CURRENT directory and the path of its subfiles from 'anyFile'

Back

echo -e

Front

write to screen... see the escape characters
, \t etc.

Back

sort -t ":" -k2-6 someFile

Front

like cut, but uses a delimeter to get only fields 2, 3, 4, 5 and 6 for sorting the givenFile

Back

Section 2

(50 cards)

date

Front

retrieve the system date and time

Back

export

Front

creates an environment variable only for current instance of shell

Back

ls -i

Front

show inodes of files

Back

bc

Front

calculator

Back

test

Front

performs logic or conditions

Back

bg jobNumber

Front

move a job to the background

Back

sh

Front

run a script in the default shell

Back

rm -i

Front

interactively delete a file

Back

touch

Front

create a new file

Back

mv

Front

rename a file

Back

sleep 20 ctrl-c

Front

start sleep timer, but kill the process

Back

eval

Front

run through commands twice for evaluating variables

Back

ctrl-z

Front

suspend a current job

Back

printenv

Front

list environment variables other than env

Back

export

Front

create an environment variable

Back

ctrl-z

Front

pause a process and send it to the background

Back

mv

Front

move a file OR a directory

Back

let

Front

perform integer math

Back

sleep 20 ctrl-Z

Front

start sleep timer, but pause it in the background

Back

mv

Front

rename a directory

Back

rm -i

Front

prompt deletion of a file

Back

kill %jobnumber

Front

terminate a job

Back

ls -a

Front

show hidden files

Back

ls -r

Front

show a reverse order of files

Back

rmdir

Front

remove a directory

Back

sleep 20 &

Front

have program sleep in the background for 20 seconds

Back

rm -r

Front

remove a directory without using rmdir

Back

tree

Front

diplay the directories as a tree

Back

&

Front

continue a process running in the background

Back

hard link

Front

corresponding files updated if moved

Back

ls -l

Front

show all details of files

Back

ls -R

Front

show a recursive list of files (include subdirectories)

Back

` `

Front

evaluate an expression without using $( )

Back

stat -c%i bin

Front

get the inode for bin

Back

kill processId

Front

terminate a process

Back

finger username

Front

get information on a user - login name, name, directory, shell, mail, plan how long on system

Back

clear

Front

clear the scren

Back

fg jobNumber

Front

resumes a job in the background

Back

stat bin

Front

get filename, size, blocks. IO block, file Type, Device info Inode, number of links, access, modify and change time

Back

test

Front

same as [ ]

Back

bc

Front

perform floating point math

Back

mkdir

Front

creat a directory

Back

ctrl-c

Front

terminate current job

Back

" "

Front

escapes metacharacters - variables interpreted

Back

readlink -m someFileName

Front

get the Absolute path of a file including the file name

Back

rm -r

Front

delete a file and all its subdirectories

Back

&

Front

start a command running in the background

Back

env

Front

show the environment variables

Back

' '

Front

escapes metacharacters - nothing interpreted

Back

sleep 11

Front

cause script to pause for 11 seconds

Back

Section 3

(50 cards)

which

Front

find the full path of a command

Back

' '

Front

always a literal

Back

$USER

Front

user i.d. of person currently logged on

Back

$PATH

Front

list of directories the command line interpreter will search when you enter a command

Back

xargs

Front

access a variable amount of arguments

Back

alias dir='ls -l'

Front

run ls-l by typing dir

Back

$[5+9]

Front

integer math

Back

[a-z]

Front

look for one character in a-z globbing

Back

[[regex]] =~

Front

regex in conditional logic statements

Back

whoami

Front

show user currently logged on to the session

Back

.

Front

regex match only one character

Back

users

Front

show who is logged on by login name

Back

[a-z]

Front

regex match any one lower case letter

Back

globbing

Front

pattern matching file searching

Back

+

Front

regex extended match ONE or more of previous

Back

$HOME

Front

path to the user's home directory

Back

[x]

Front

look for x globbing

Back

L{n,m}

Front

regex extended match between n and m occurrences of L

Back

[^bd]

Front

look for all chars except b or d globbing (do not use !)

Back

X*

Front

regex match ZERO or more occurrences of previous (i.e. X)

Back

$touch file{1,2,3}

Front

create file1 file2 and file3 in one command

Back

^

Front

regex match the start of line

Back

L{n}

Front

regex extended match exactly n occurrences of L

Back

[...]

Front

regex match any of a set of chars once

Back

? globbing

Front

globbing match any single character MUST be a character

Back

[!bd]

Front

look for all chars except a or g globbing (do not use ^ )

Back

let

Front

integer math withouth $(( )) or $[ ]

Back

' ! $ ; * &

Front

regex chars require escaping to use as a literal

Back

[0-9]

Front

regex match any one digit

Back

bc <<< "scale=9; 18.26/14.75"

Front

floating point division to 9 places for 18.26 div by 14.75 WITHOUT using echo

Back

"scale=9; 18.26/14.75" | bc

Front

floating point division to 9 places for 18.26 div by 14.75

Back

" "

Front

expands variables

Back

* globbing

Front

globbing zero or more characters

Back

X|Y

Front

regex extende match X or Y

Back

[^...]

Front

regex match the opposite of the set of chars

Back

L{n,}

Front

regex extended match n or more occurrences of L

Back

{ , , ,}

Front

match a list of options

Back

!!

Front

at command line only - history of commands and aliases

Back

~

Front

path to the user's home directory

Back

grep -E

Front

option for extended grep

Back

who

Front

show who is logged on date and time

Back

export

Front

create environment variables

Back

"scale=3; 5/2" | bc

Front

floating point division to 3 places for 5 div by 2

Back

+ {} () \ |

Front

regex extended operators

Back

$((2-4))

Front

integer math

Back

w

Front

show who is logged on and what they are doing

Back

tokens

Front

pieces of sequence in parcing

Back

$SHELL

Front

stores the name of the shell you are using

Back

egrep

Front

command for extended grep

Back

[A-Z]

Front

regex match any one Upper case letter

Back

Section 4

(50 cards)

for i in a x Name 10 do done

Front

loop through a list

Back

-gt

Front

numeric greater than

Back

-s

Front

flag to see if exists AND has non-zero size i.e exists and is NOT empty

Back

~+

Front

current directory

Back

clear

Front

clear the screen

Back

$var != 'Steve'

Front

string comparison not same string

Back

Sh-Bang! #!/bin/bash #!/bin/ksh

Front

how all scripts begin

Back

$0

Front

name of the script

Back

&&

Front

logic AND

Back

-n

Front

flag to see if a STRING is not empty

Back

-z

Front

flag to see if a STRING has zero length

Back

for ((i=1;i<10;i++))

Front

iterative loop

Back

||

Front

logic OR

Back

$(command)

Front

how to refer to the value sent to standard output by a command

Back

continue

Front

jump to top of loop without executing rest of commands beyond that point

Back

getopts

Front

recognize arguments starting with - as options

Back

case $somevar in a) do something ;; b) do something else ;; *) default something ;; esac

Front

case statement

Back

$1

Front

first parameter

Back

-lt

Front

numeric less than

Back

$?

Front

holds exit or return status of previous command executed

Back

$(command)

Front

command substitution syntax

Back

$var = 'some string here'

Front

string comparison same string

Back

function doThis() { }

Front

function

Back

-x

Front

flag to see if exists AND is executable

Back

read -n1 -p "Press any key to continue"

Front

get only one character from user

Back

[ ] single square brackets

Front

syntax for logic using if, while or until

Back

$OPTIND

Front

first non option argument

Back

while getopts abc varName do case $varName in a) ;; b) ;; c) ;; \?) ;; for anything else esac cone

Front

getopts

Back

~-

Front

last directory you were in

Back

-le

Front

numeric less than OR equal

Back

~

Front

home directory

Back

#!/bin/bash

Front

Sh-Bang!

Back

$var -eq 728

Front

numeric comparison for equal values

Back

tput cup x y

Front

move the cursor to coordinate x,y

Back

$(( $(command) + 1 ))

Front

sum arithmetic where a command is one of the values to be added

Back

-f

Front

flag to see if it is a regular file

Back

-ne

Front

numeric NOT equal

Back

-ge

Front

numeric greater than OR equal

Back

break

Front

exit a loop

Back

read -p "prompt: " var

Front

store user input in a variable named var

Back

-e

Front

flag to see if file OR directory exists

Back

shift $(($OPTIND-1))

Front

move to first argument after the options

Back

while [ ] do done

Front

while loop

Back

-d

Front

flag to see if exists and is a directory

Back

stty

Front

change and print terminal line settings

Back

test

Front

syntax for logic NOT using [ ] single brackets

Back

sh

Front

execute a script not set up with sh-bang

Back

until [ ] do done

Front

until loop

Back

if [ ] ; then elif [ ] ; then else fi

Front

if statement

Back

-r

Front

flag to see if exists AND is readable

Back

Section 5

(50 cards)

kill $!

Front

kill the last background job

Back

:8 within vim

Front

send cursor to beginning of line 8 in vim

Back

x within vim

Front

deletes the current character in vim

Back

uname -a

Front

find what operating system your unix is running on

Back

mkfs

Front

make a new file system

Back

:%s/old/new/gc

Front

search,confirm and replace all occurrences in the file in vim

Back

D within vim

Front

delete the text from the cursor to the end of the line in vim

Back

ZZ within vim

Front

save your work and exit vim

Back

var=$(ls -l)

Front

command substitution

Back

mesg

Front

restrict incoming messages

Back

:s/old/new/g within vim

Front

search and replace all occurrences on current line in vim

Back

dw within vim

Front

delete the current word in vim

Back

text

Front

how are all variables in bash

Back

4gg within vim

Front

move to line 4 in vim

Back

U within vim

Front

undo all changes to the current line in vim

Back

tee

Front

read from stdin and write to both stdout AND to files

Back

A within vim

Front

append to the end of the current line in vim

Back

:wq within vim

Front

save your work and exit vim

Back

R within vim

Front

enter replace mode in vim

Back

${var}.txt if var=bin then returns bin.txt

Front

delineate a variable

Back

>

Front

redirect standard output to a file replacing the file

Back

2

Front

stderr

Back

1

Front

stdout

Back

> /dev/null

Front

get rid of output you don't want

Back

$

Front

syntax for referencing variables

Back

:nohlsearch within vim

Front

turn off highlights in vim

Back

2>$1

Front

redirect stderr to stdout

Back

u within vim

Front

undo last change in vim

Back

${myArray[2]}

Front

get the third value from myArray

Back

i within vim

Front

insert mode

Back

/abigail within vim

Front

highlight the word abigail throught your vim file

Back

G within vim

Front

move to the end of the file

Back

0

Front

stdin

Back

some command <<< hello

Front

Here string

Back

dd within vim

Front

delete the current line in vim

Back

${someArray[*]}

Front

get all the values from someArray

Back

${#var}

Front

get the length of the contents of var

Back

:q! within vim

Front

exit vim without saving

Back

array=(x y z j k)

Front

declare an array containing x,y,z,j,k

Back

echo -n $var | wc -c

Front

get the length of the contents of var without using ${#var}

Back

:s/old/new within vim

Front

replace all occurences of 'old' with 'new' in vim

Back

1>$2

Front

redirect stdout to stderr

Back

echo 'hello' | tee f1 f2

Front

send hello to stdin and to files f1 and f2

Back

a within vim

Front

append after the cursor character in vim

Back

>>

Front

append standard out put to the end of a file

Back

r within vim

Front

replace one character (returns you to command mode) in vim

Back

tput

Front

initialize a terminal or query terminfo database

Back

I within vim

Front

insert at end of the current line in vim

Back

8gg within vim

Front

send cursor to beginning of line 8 in vim

Back

gg within vim

Front

move to the top of the file in vim

Back

Section 6

(6 cards)

paging

Front

only required pages are moved to main memory for execution. allows for greater process size than the physical memory

Back

df

Front

report file system disk space usage

Back

telnet

Front

test if a remote host is alive (other than ping)

Back

swapping

Front

whole process is moved to main memory for execution. must be less or equal to physical memory

Back

top

Front

find %cpu each process is occupying

Back

ping

Front

test if a remote host is alive

Back