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

*

23
Q

?

A

any 1 character

24
Q

[abc]

A

Any char in set

25
[!abc]
Any char not in set
26
$
Variables
27
Cp
Copy
28
History
500 lines of history
29
History n
Most recent n cmds
30
History -c
Delete history
31
!!
Repeat last cmd
32
!n
Repeat cmd n
33
! -n
Repeat cmd n cmds ago
34
!foo
Repeat cmd started with foo
35
Env
Display environment variables
36
“=“
Set bar
37
$PATH
Displays list directory
38
Export
Export shell variables
39
- e - fi - d - w - o
- 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
Make vars ints
Have to use casting | (y=y+1)
41
Or / and
&& ||
42
-lt
Less than
43
mkdir
``` Make directory (creates a new folder) Ex) mkdir ~/Desktop/seng265 ```
44
mv
Moves file from one place to another | ex) mv
45
Vim [filename]
Opens file in txt editor (creates new file if non specified Command mode: issue cmds Insert mode: type text
46
Set
Displays environment and shell variables