Bash Cmds Flashcards

1
Q

Cd

A

Change directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

.. or .

A

Parent directory

Current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

~

A

Home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Vi

A

Text editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Ls

A

List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Ls user

A

Lists directories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Pwd

A

Print working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Ls-s

A

Reference to a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Chmod

A

Give permissions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Less[file]

A

Show one page at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Touch file

A

Create a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Ls -l file

A

Gives info about file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Echo

A

Display a line of txt/str on stdr or file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Rm

A

Remove

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Type

A

Determine if cmd built in, an alias, or executable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Cat[file 1,file 2]

A

Copy files to stdout as listed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Date

A

Displays date and time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Wc[file]

A

Word count (#lines, words, chars)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Clear

A

Clears screen

20
Q

help[cmd]

A

Display description of shell cmd

21
Q

< > &raquo_space; >& <>

A
  • stdin
  • stdout
  • append
  • stdout/stderr
  • stdout/stdin
22
Q

*

A

All

23
Q

?

A

any 1 character

24
Q

[abc]

A

Any char in set

25
Q

[!abc]

A

Any char not in set

26
Q

$

A

Variables

27
Q

Cp

A

Copy

28
Q

History

A

500 lines of history

29
Q

History n

A

Most recent n cmds

30
Q

History -c

A

Delete history

31
Q

!!

A

Repeat last cmd

32
Q

!n

A

Repeat cmd n

33
Q

! -n

A

Repeat cmd n cmds ago

34
Q

!foo

A

Repeat cmd started with foo

35
Q

Env

A

Display environment variables

36
Q

“=“

A

Set bar

37
Q

$PATH

A

Displays list directory

38
Q

Export

A

Export shell variables

39
Q
  • e
  • fi
  • d
  • w
  • o
A
  • switch that determines if file at a particular path
  • end of an if block
  • True if file is reg file
  • true if file exists and is writable
  • true if your the user
40
Q

Make vars ints

A

Have to use casting

(y=y+1)

41
Q

Or / and

A

&& ||

42
Q

-lt

A

Less than

43
Q

mkdir

A
Make directory (creates a new folder)
Ex) mkdir ~/Desktop/seng265
44
Q

mv

A

Moves file from one place to another

ex) mv

45
Q

Vim [filename]

A

Opens file in txt editor (creates new file if non specified

Command mode: issue cmds
Insert mode: type text

46
Q

Set

A

Displays environment and shell variables