Basic Commands Flashcards

1
Q

What is the command to see the current working directory?

A

pwd

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

What is the command to list items in current directory?

A

ls

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

What is the command to change directory?

A

cd

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

What symbol represents home?

A

~

tilda

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

What is the command to change directory outside the current one?

A

cd ..

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

What is the command to see all files and directories (including hidden)?

A

ls -a

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

What denotes a file or folder being hidden?

A

.

i.e .hiddenfolder

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

What is the command to create a file?

A

touch

i.e touch file.txt

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

How can you read the contents of a text file?

A

cat

i.e cat file.txt

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

What is the command to create a directory?

A

mkdir

i.e mkdir Folder1

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

What is the command to move a file?

A

mv

i.e mv file.txt ..

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

What is the command to remove an empty directory?

A

rmdir

i.e rmdir Folder1

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

What is the command to remove a directory containing items?

A

rm -r

i. e rm -r Directory1
* rm without parameter -r only removes files, r means recursively

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

What is the command to get help with a specific command?

A

man

i.e man mv

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

What is the shortcut to go to the beginning of the line in the shell?

A

ctrl + a

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

What is the shortcut to go to the end of the line in the shell?

A

ctrl + e

17
Q

What is the shortcut to do a history search of commands?

A

ctrl + r

press combination again to iterate through previous commands

18
Q

What is the command to create a symbolic link to an item?

A

ln

i. e ln -s /path/to/file /path/to/smylink
* must specify absolute path

19
Q

What is the command to see the first 10 lines of text in a file?

A

head

20
Q

What is the command to see the last 10 lines of text in a file?

A

tail

21
Q

What is the command to list items with detailed accompanying information?

A

ls -l

22
Q

What is the command to view the contents of a text file in real time?

A

tail -f

23
Q

What are some commands to shutdown/reboot the system?

A

poweroff
shutdown -r now
halt -r +1

24
Q

What is the command to see who is logged on?

A

w

25
Q

What is the command to see what is running on a machine?

A

top

26
Q

What is the command to see what internet ports are open?

A

netstat

i.e netstat -tupln

27
Q

How do you edit a text document from the command line?

A

nano
vi
i.e vi text.txt

28
Q

How doe you use vi?

A
vi
i - insert mode
d - delete mode
esc - escape current mode
\:wq! - save and exit
\:qa! - discard and exit
29
Q

What is the command to rename a file or directory?

A

mv file renamedfile

mv file without specifying location path

30
Q

What is the command to copy a file or directory?

A

cp

31
Q

What is the command to see a current list off all running processes?

A

ps

i.e ps -axu - to see all running processes