Linux Commands Flashcards

1
Q

pwd

A

Finds the path of the current working directory.

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

cd

A

Used to navigate through files and directories.

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

cd ..

A

Go to the parent directory.

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

cd-

A

Move to the previous directory.

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

ls

A

View contents of the current directory.

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

ls -R

A

List contents of current directory and sub-folders.

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

ls -a

A

List contents of the current directory and show hidden files.

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

ls -al

A

List contents of the current directory with detailed information like permissions, size, owner, ect.

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

cat

A

Lists the contents of a file on the standard output (sdout).

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

cp

A

Copy, copies files from the current directory to a different directory. Format cp ‘file’ ‘new directory’

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

mv

A

Move, used to move the directory of files, can also be used to rename files.

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

mkdir

A

Make a directory, used to make a new directory.

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

rmdir

A

Remove directory, only allows removal of empty directories.

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

rm

A

Removes files.

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

rm -r

A

Removes a directory and all the files within.

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

touch

A

Create a blank new file.

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

locate

A

Used to find a file, like a search bar in windows file explorer.

18
Q

locate -i

A

Used to find a file however is case sensitive.

19
Q

find

A

Used to find files and directories, can be used to find files within a given directory.

20
Q

grep

A

Let’s you search through all text in a file.

21
Q

sudo

A

Super-user do, perform an action with root permission.

22
Q

df

A

Gives a report on the systems disk space usage.

23
Q

du

A

Used to show how much space a file or directory takes up on a disk however will show block numbers rather than usual size, -h argument shows size unit.

24
Q

head

A

Used to view the first 10 lines of any text file.

25
tail
Used to display the last 10 lines of any text file.
26
diff
Compare the contents of two files line by line and outputs the lines that do not match.
27
tar
Used to archive multiple files into a tarball.
28
chmod
Used to modify read, write and execute permissions of files and directories.
29
chown
Used to modify the owner of a file.
30
jobs
Displays all jobs and their statuses.
31
kill
Used to force close a program. You can send a signal with this command, there are 64 of them, the common ones are SIGTERM (15) which requests a program to stop then SIGSKILL (9) which forces a program to stop immediately.
32
ping
Used to check the connection to a server. Will send a connection and output the response, if it was successful.
33
wget
Downloads files from the internet when given a link.
34
uname
Short for unix name, will print detailed information about your system.
35
history
Outputs a history of previously entered commands.
36
man
Gives instructions for the given command, for example, man tail will explain what the tail command does.
37
echo
Used to move data into a file, for example 'echo Hello, my name is Bronson >> name.txt' will put the text into the txt file.
38
zip
Will compress and zip files into a zip archive.
39
unzip
Will unzip files from an archive.
40
hostname
Will return the hostname of the network, adding an -I will display the IP address of the network.
41
useradd
Will add a user to the system.
42
userdel
Will delete a user from the system.