Linux (BASH) sample commands Flashcards

1
Q

/

A

root directory

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

ls

A

list directories

ex. ls/ lists directories in main directory

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

ls -help

A

tells what command flags are and what they do

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

man -ls

A

same information as “-help” but with a little more detail

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

ls -long

A

extra information about directories and files and folders in them

  • this is like windows “show properties”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

ls -a

A

all files in the directory including hidden files

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

History (or ctrl+r)

A

show previous commands and navigate up and down to execute them again

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

clear

A

clear screen that is cluttered

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

mv

A

renames or moves files to a different directory

to change name just type mv and the original name and then the new name right after it

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

rm

A

remove files and directories

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

cat

A

gets contents of a file and outputs the contents to the screen

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

less

A

=more in windows

gets the contents of the file (especially a larger one and displays it to the terminal window until it fills it. You can then advance content at your own pace)

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

up and down keys

A

advances contents of the screen by one line after “less” command

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

page up and page down keys

A

advances contents of the screen by one page after less command

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

lowercase g

A

moves to the beginning of a file after less command

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

capital G

A

moves to the end of a file after the less command

17
Q

/[word}

A

/word-search - allows you to search for a word or phrase

18
Q

q

A

quit out of the less command and return to the shell

19
Q

cat -head

A

displays first few lines of a file (by default 10 lines)

20
Q

cat -tail

A

displays the last few lines of a file (by default 10)

21
Q

nano [file name]

A

text editor like notepad++ in windows

22
Q
A

ctrl key

23
Q

grep

A

searches for a string in a group of files

like the select-string in powershell

24
Q

(pipe character)

A

send command

it sends or “pipes” output to next location

25
Q

cp

A

copy files

26
Q

-r

A

recursive copy

27
Q

>

A

redirect command for standard output

28
Q

> >

A

append (add) to a file

29
Q

<

A

standard input operator (redirector)

30
Q

/dev/null

A

sends unwanted output to the netherworld

like $null in windows powershell

31
Q

2>

A

redirector for standard error (stderr)