Linux Commands Flashcards

1
Q

What does the pwd command do in Linux?

A

Shows the current directory location.

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

What is the purpose of the ls command?

A

Lists the contents of the current directory

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

How do you navigate to and from directories using the cd command?

A

Example: cd /var/log.
Move to home directory: cd ~
Move to the parent directory: cd ..
Gives the current directory name: cd .

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

How do you move or rename files with the mv command?

A

Example: mv test4.txt test3.txt /home/student01/Documents/.

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

What is the command to copy files and directories in Linux?

A

cp.
Example: cp test1.txt test2.txt /home/student01/Documents.

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

How do you remove files and directories with the rm command?

A

rm does not remove directories by default; use -r for recursive removal or -d if the directory is empty.

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

What command is used to find files in Linux?

A

find

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

How do you concatenate files and view file data using the cat command?

A

Show contents of a file: cat test1.txt
Show contents of two files: cat test1.txt test2.txt
Combine contents of 2 files and output results to another file: cat test1.txt test2.txt > test3.txt

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

How do you search for patterns in files using the grep command?

A

Example: cat test1.txt | grep had.

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

Name two file editors commonly used in Linux.

A

nano and vi.

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

How do you install software on Debian/Ubuntu systems?

A

apt install. Example: apt install net-tools.

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

How do you install software on RHEL/CentOS systems?

A

yum install or dnf install. Example: yum install htop or dnf install htop.

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

What command elevates privileges to superuser in Linux?

A

sudo. Example: sudo apt install net-tools.

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

How do you switch users using the su command?

A

su switches to root if no options are specified. Example: su wbryan.

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

How do you change file permissions with the chmod command?

A

Example: sudo chmod a-w test1.txt or sudo chmod a+w test1.txt.

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

How do you change file ownership with the chown command?

A

Use chown. Example: sudo chown user:group file.

17
Q

Which command configures network interfaces in Linux?

A

ifconfig. Example: ifconfig.

18
Q

What is the currently preferred IP configuration utility in Linux?

A

ip. Example: ip addr.

19
Q

How do you test the Domain Name System (DNS) in Linux?

A

dig.

20
Q

Which commands provide a snapshot of current processes in Linux?

A

ps and top.

21
Q

What command is used to terminate processes in Linux?

A

kill.

22
Q

What does the command “man” do?

A

Manual for commands

23
Q

What does the command df do?

A

displays information about total space and available space on a file system.

24
Q

What does the command dd do?

A

Copy hard drives, partitions, CD drives, etc.

25
Q

What does the command shutdown do?

A

Shuts down the system you’re working on.