Linux Commands Flashcards

1
Q

ls

A

Lists files and directories in the current directory.

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

cd

A

Changes the current directory (e.g., cd /home/user).

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

pwd

A

Prints the current working directory path.

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

mkdir

A

Creates a new directory (e.g., mkdir new_folder).

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

rmdir

A

Deletes an empty directory.

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

rm

A

Deletes files or directories (use rm -r for directories).

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

cp

A

Copies files or directories (e.g., cp file.txt /backup/).

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

mv

A

Moves or renames files and directories.

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

touch

A

Creates an empty file or updates the timestamp of an existing file.

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

cat

A

Displays the contents of a file.

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

nano

A

Opens a simple text editor in the terminal.

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

vi or vim

A

Opens the vi or vim text editor for editing files.

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

man

A

Displays the manual page for a command (e.g., man ls).

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

echo

A

Prints text to the terminal or redirects it to a file (e.g., echo “Hello” > file.txt).

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

grep

A

Searches for a specific pattern in files (e.g., grep “error” log.txt).

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

find

A

Searches for files and directories based on conditions.

17
Q

chmod

A

Changes file permissions (e.g., chmod 755 file.sh).

18
Q

chown

A

Changes file ownership (e.g., chown user:group file.txt).

19
Q

df

A

Displays disk space usage of file systems.

20
Q

du

A

Shows disk usage of files and directories.

21
Q

ps

A

Displays information about running processes.

22
Q

sudo

A

Runs commands with elevated privileges.

23
Q

ssh

A

Connects to a remote server securely.

24
Q

ifconfig

A

Configures network interfaces (deprecated, replaced by ip).

25
Q

ip

A

Displays or modifies IP address and network configurations.

26
Q

ping

A

Tests connectivity to a remote host by sending ICMP packets.

27
Q

traceroute

A

Traces the route packets take to reach a destination.

28
Q

hostname

A

Shows or sets the system hostname.

29
Q

shutdown

A

Shuts down or restarts the system (e.g., shutdown -h now).