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
>>
Redirect standard output from a command to a file, appending to the file's existing contents.
26
top
Display information about running processes. continuous until stopped.
27
kill
Terminate a process by sending a signal.
28
tar
Create, extract, or list the contents of a tar archive.
29
gzip
Compress or decompress files using the gzip format.
30
ssh
Secure Shell client for remote logins and command execution.
31
scp
Securely copy files between hosts using SSH.
32
wget
Download files from the web.
33
diff
Compare files line by line and display differences.
34
curl
Transfer data from or to a server using various protocols, often used for API interactions.
35
history
Display the command-line history.
36
alias
Create a shorthand or alias for a longer command.
37
yum
Package management system for Red Hat-based systems.
38
apt
Package management system for Debian and Ubuntu-based systems.
39
groupdel
Delete a group.
40
groupadd
Create a new group.
41
useradd
Create a new user account.
42
crontab
Schedule tasks to run at specific times, manage the cron table for a user.
43
traceroute
Display the route and transit delays of packets across an IP network.
44
ping
Send network packets to test the reachability of a host on an IP network.
45
ifconfig
Display and configure network interfaces.
46
uname
Display system information, such as the operating system name, kernel version, and hardware platform.
47
userdel
Delete a user account and related files.
48
apropos
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
tree
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
which
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
locate
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
wc
counts the number of lines, words, and bytes in a file. It can also count characters if the '-m' option is used.
53
What is tar used for in linux?
tar is used for archiving files (combining all files into one)
54
What is gzip used for in linux?
gzip is used for compressing file (making the file size smaller)
55
dpkg
used to manage Debian packages (.deb files) on Debian and Debian-based Linux distributions.
56
pico
text editor that provides less features and less complexity
57
usermod
used to modify the user's account
58
passwd
used to change or reset the password of the user's account
59
groupmod
used to modify a group
60
dnf
updated version of yum command and used to install and remove software on Red Hat
61
rpm
low-level too that is used to install and remove software on Red Hat
62
ip
used for configuring network interfaces. updated version of 'ifconfig'
63
dig
used to query the DNS to get information about the different DNS records
64
what does the '$' do?
used to reference the value of a variable.
65
chsh
change the shell you are using. -s to change default and put the path to the shell after.
66
*
wildcard. b* for example, will show all files starting with letter 'b'
67
?
wildcard for a single letter
68
df
used to display the amount of available and used disk space. Also displays the file system type and its mount point.
69
du
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
What are the 3 file descriptors?
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
What does < do?
uses file or stream as input for a command instead of typing
72
What does EOF function do?
ends user input
73
What does '<<' do?
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
How to redirect errors?
'command' '2> /dev/null'
75
What does | do?
redirects STDOUT from one command to be processed by another