Linux Commands Flashcards

1
Q

ls

A

List the contents of a directory.

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

cd

A

Change the current working directory.

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

pwd

A

Print the current working directory.

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

mkdir

A

Create a new directory.

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

rmdir

A

Remove an empty directory.

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

rm

A

Remove files or directories.

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

cp

A

Copy files or directories.

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

mv

A

Move or rename files or directories.

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

touch

A

Create an empty file or update the access and modification times of an existing file.

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

cat

A

Concatenate and display files.

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

less

A

View the contents of a file one screen at a time.

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

grep

A

search for a string in groups of files. When it finds a pattern that matches in more than one file, it prints the name of the file, followed by a colon, then the line matching the pattern.

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

find

A

Search for files in a directory hierarchy based on criteria such as name, size, or modification time.

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

chmod

A

Change the file permissions.

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

whoami

A

Display the username of the current user.

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

echo

A

Output text or variables to the terminal or a file.

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

man / -h

A

Display the manual page for a specified command or keyword.

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

su

A

Switch to another user account or temporarily elevate privileges.

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

ps

A

Display information about running processes. single snapshot and does not continuously run.

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

systemctl

A

manages both system and service configurations, enabling administrators to manage the OS and control the status of services

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

sha256sum

A

Calculate and verify SHA256 checksums for files.

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

&

A

Run a command in the background, allowing other tasks to be performed simultaneously.

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

&&

A

Execute the next command only if the previous command has succeeded (returned a zero exit status).

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

>

A

Redirect standard output from a command to a file, overwriting the file’s existing contents.

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

> >

A

Redirect standard output from a command to a file, appending to the file’s existing contents.

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

top

A

Display information about running processes. continuous until stopped.

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

kill

A

Terminate a process by sending a signal.

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

tar

A

Create, extract, or list the contents of a tar archive.

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

gzip

A

Compress or decompress files using the gzip format.

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

ssh

A

Secure Shell client for remote logins and command execution.

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

scp

A

Securely copy files between hosts using SSH.

32
Q

wget

A

Download files from the web.

33
Q

diff

A

Compare files line by line and display differences.

34
Q

curl

A

Transfer data from or to a server using various protocols, often used for API interactions.

35
Q

history

A

Display the command-line history.

36
Q

alias

A

Create a shorthand or alias for a longer command.

37
Q

yum

A

Package management system for Red Hat-based systems.

38
Q

apt

A

Package management system for Debian and Ubuntu-based systems.

39
Q

groupdel

A

Delete a group.

40
Q

groupadd

A

Create a new group.

41
Q

useradd

A

Create a new user account.

42
Q

crontab

A

Schedule tasks to run at specific times, manage the cron table for a user.

43
Q

traceroute

A

Display the route and transit delays of packets across an IP network.

44
Q

ping

A

Send network packets to test the reachability of a host on an IP network.

45
Q

ifconfig

A

Display and configure network interfaces.

46
Q

uname

A

Display system information, such as the operating system name, kernel version, and hardware platform.

47
Q

userdel

A

Delete a user account and related files.

48
Q

apropos

A

Search the manual page names and descriptions for a specified keyword, helping to find relevant commands or manual pages based on a particular topic or functionality. Equivalent to using man -k.

49
Q

tree

A

displays the directory structure of a given path in a tree-like format. It shows the nested arrangement of directories and files, making it easier to visualize the hierarchy of the filesystem.

50
Q

which

A

locates the executable file associated with a given command. It searches through the directories listed in the PATH environment variable and returns the path of the first match it finds.

51
Q

locate

A

searchs for files and directories by name. It uses a database created by the ‘updatedb’ command to perform a fast search. It is case-insensitive by default but can be made case-sensitive using the ‘-i’ option.

52
Q

wc

A

counts the number of lines, words, and bytes in a file. It can also count characters if the ‘-m’ option is used.

53
Q

What is tar used for in linux?

A

tar is used for archiving files (combining all files into one)

54
Q

What is gzip used for in linux?

A

gzip is used for compressing file (making the file size smaller)

55
Q

dpkg

A

used to manage Debian packages (.deb files) on Debian and Debian-based Linux distributions.

56
Q

pico

A

text editor that provides less features and less complexity

57
Q

usermod

A

used to modify the user’s account

58
Q

passwd

A

used to change or reset the password of the user’s account

59
Q

groupmod

A

used to modify a group

60
Q

dnf

A

updated version of yum command and used to install and remove software on Red Hat

61
Q

rpm

A

low-level too that is used to install and remove software on Red Hat

62
Q

ip

A

used for configuring network interfaces. updated version of ‘ifconfig’

63
Q

dig

A

used to query the DNS to get information about the different DNS records

64
Q

what does the ‘$’ do?

A

used to reference the value of a variable.

65
Q

chsh

A

change the shell you are using. -s to change default and put the path to the shell after.

66
Q

*

A

wildcard. b* for example, will show all files starting with letter ‘b’

67
Q

?

A

wildcard for a single letter

68
Q

df

A

used to display the amount of available and used disk space. Also displays the file system type and its mount point.

69
Q

du

A

used to estimate the disk pace usage of a file or directory. It shows the size of the file or directory, as well as the size of its subdirectories, if any.

70
Q

What are the 3 file descriptors?

A

Data Stream for Input
STDIN – 0
Data Stream for Output
STDOUT – 1
Data Stream for Output that relates to an error occurring.
STDERR – 2

71
Q

What does < do?

A

uses file or stream as input for a command instead of typing

72
Q

What does EOF function do?

A

ends user input

73
Q

What does ‘«’ do?

A

is used to pass multiple lines of input to a command. It allows you to define a block of input text within a script or command line, and that block will be passed as input to the command.

74
Q

How to redirect errors?

A

‘command’ ‘2> /dev/null’

75
Q

What does | do?

A

redirects STDOUT from one command to be processed by another