Unit 4 Module 3 - Linux Bash Commands Flashcards

1
Q

What command prints the working directory to the screen?

A

pwd

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

What command displays names of the files and directories in the current working directory?

A

ls

(LS)

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

What command navigates between directories?

A

cd

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

What command displays the content of a file?

Reading File Content Command

A

cat

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

What command displays just the beginning of a file? ( First 10 lines of text files )

Reading File Content Command

A

head

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

What command displays just the end of a text file? ( First 10 lines )

Reading File Content Command

A

tail

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

What command returns the content of a file one page at a time?

Reading File Content Command

A

less

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

What command searches a specified file and returns all lines in the file containing a specified string?

Searching for a certain keyword in a file

A

grep

grep OS updates.txt

grep is the command.
OS is the arguement we are looking for
updates.txt is the file we are looking into

Searching for a certain keyword in a file

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

What sends the standard output of one command as standard input to another command for further processing?

A

| (Piping)

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

What command searches for directories and files that meet a specified criteria?

A

find

find /home/analyst/projects searches for everything starting at the projects directory.

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

What do you call modifying the behavior of a command and commonly begins with a hyphen ( - ) ?

A

Options

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

What command creats a new directory?

A

mkdir

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

What command deletes a directory?

A

rmdir

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

What command creats a new file?

A

touch

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

What command deletes a file?

A

rm

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

What command moves a file or a directory to a new location?

A

mv

17
Q

What command copies a file or directory into a new location?

A

cp

18
Q

What command displays permissons to files and directories?

A

ls -l

( LS -L )

19
Q

What command displays permssions to files and directories including hidden files?

A

ls -la

(LS -LA)

20
Q

What command changes permissions on files and directories?

A

chmod

stands for change mode

21
Q

What are the commands for the 3 types of users?

User, Group, and Other

A

User = u
Group = g
Other = o

The + adds permssions and - minus permissions.

chmod g+w, o-r access.txt

22
Q

What does each letter/symbol mean in this equation?

chmod g+w, o-r access.txt

A

chmod - Change permssions with files/directories
g+w - Group has gained the permssion to write
, - is giving you the ability to do more commands
o-r - Other is lossing the reading permssion

These are changing the permssions of access.txt

23
Q

What is the character for each of the reading permissions?
1) Read
2) Write
3) Execute

A

1) Read - r
2) Write - w
3) Execute - x

24
Q

What is this reading permssion?

For files, this is the ability to read the file contents; for directories, this is the ability to read all contents in the directory including both files and subdirectories

A

Read permission

25
Q

What is this reading permission?

For files, this is the ability to make modifications on the file contents; for directories, this is the ability to create new files in the directory

A

Write permission

26
Q

What is this reading persmisson?

For files, this is the ability to execute the file if it’s a program; for directories, this is the ability to enter the directory and access its files

A

Execute permission

27
Q

What does the = command mean?

A

Assigns permissions for the user, group, or other.

28
Q

What command displays information on other commands how they work?

A

man

(Manual)

29
Q

What command searches the manual page descriptions for a specified string?

A

**apropos **

30
Q

What command displays a description of a command on a single line?

ex) whatis nano

A

whatis

This command is useful when you don’t need a detailed d

ex) whatis nano