Section 1.11 -- Linux Commands Flashcards

(27 cards)

1
Q

What is the help command in Linux?

A

Man for manual. eg. man grep

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

How to list directory contents in Linux?

A

LS – list directory. Lists files, directories, symbolic links. Color-codes files.

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

How to get a more detailed directory view in Linux?

A

ls -l OR type ls -l | more to present output one page at a time

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

What does a detailed directory view (in Linux) show?

A

Permissions, file owner, group that owns the file, file size, and date of last update.

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

How to display the current working directory path in Linux?

A

pwd – print working directory. useful when changing directories often.

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

how to change the name of a directory in Linux?

A

mv – move a file. syntax is mv SOURCE DESTINATION

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

how to copy a file in Linux?

A

cp SOURCE DEST. new file will be named whatever “dest” is

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

how to remove files or directories in Linux?

A

rm deletes files and (empty) directories

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

What are the permissions associated with a file in Linux?

A

r = read
w = write
x = execute

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

How are permissions listed in the Linux terminal?

A

user, group, others,

e.g. rwxr–r–, indicating that users can read write and execute, but groups and others can only read

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

What is the octal notation for permissions in Linux?

A

7 = rwx
6 = rw-
5 = r-x
4 = r–
3 = -wx
2 = -w-
1 = –x
0 = —

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

What is the command and syntax to change permissions in Linux?

A

chmod mode FILE

e.g. chmod 744 script.sh

where 744 indicates that users can rwx, but users and others are only r–

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

What is the command and syntax to change permissions in Linux (non-octal)?

A

chmod mode FILE

e.g. chmod a-w first.txt means that we’re removing write permissions from first.txt

e.g. chmod u+x script.sh means we’re adding execute permissions to the owner of script.sh

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

how to change the name of the owner and group using the linux terminal?

A

chown

syntax: sudo chown [owner:group] file

e.g. sudo chown messer third.txt changes the file owner to messer

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

How do you run a command as an admin in Linux?

A

su / sudo – runs the command as a superuser or as a different user ID. type su to become a superuser at the beginning of a session and exit to not be a superuser anymore

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

How to install an application in the Linux terminal?

A

apt-get – stands for advanced packaging tool. lets you install, update, and remove

syntax: sudo apt-get install wireshark

17
Q

How do you install an application in a Redhat-based linux system?

A

Not apt-get! Instead use yum (Yellowdog Updater, Modified) to install, delete, and update

18
Q

How do you manage network interfaces using linux?

A

the ip command allows you to look at config:

ip address

routing tables

ip rout

and configure

sudo ip address add [ip address/subnet mask dev adapter]

19
Q

How do you know how much free space is available on a Linux system?

A

df – view file systems and free space. this defaults to showing you the space available in 1k blocks.

use df -h to see human-readable units

20
Q

How do you search files using the Linux terminal?

A

grep – find text in any file on the system

syntax: grep PATTERN file.txt

21
Q

How do you see running processes on a linux system?

A

ps – view current process and process ID, similar to task manager

ps -e – see all running processes on a system

22
Q

How does the “more” command work in a Linux system?

A

you pipe the command by adding “| more” after a prompt like ps, e.g. “ps -e | more”

Press space to advance the page, enter to go line by line, and q to quit

23
Q

How do you find resource utilization in linux?

A

top – gives an overview of all running processes, CPU, RAM, and resource allocation

Hit enter to refresh, hit q to quit

24
Q

How do you find a file name or extension in linux?

A

find

syntax: find . -name “*.txt”

here, “.” indicates to start with your current directory, and “*.txt” means “any doc with a .txt extension”

25
How do you lookup information from DNS servers in Linux?
dig -- domain information groper -- detailed domain information -- can be included in windows syntax: dig www.[website].com
26
How do you merge files together using a Linux command?
cat -- aka concatenate, which means to link together in a series syntax: cat file1.txt file2.txt this will print to screen. to copy to a new third file use: cat file1.txt file2.txt > both.txt
27