Basic Commands Flashcards Preview

Linux (debian) > Basic Commands > Flashcards

Flashcards in Basic Commands Deck (31)
Loading flashcards...
1

What is the command to see the current working directory?

pwd

2

What is the command to list items in current directory?

ls

3

What is the command to change directory?

cd

4

What symbol represents home?

~
tilda

5

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

cd ..

6

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

ls -a

7

What denotes a file or folder being hidden?

.
i.e .hiddenfolder

8

What is the command to create a file?

touch
i.e touch file.txt

9

How can you read the contents of a text file?

cat
i.e cat file.txt

10

What is the command to create a directory?

mkdir
i.e mkdir Folder1

11

What is the command to move a file?

mv
i.e mv file.txt ..

12

What is the command to remove an empty directory?

rmdir
i.e rmdir Folder1

13

What is the command to remove a directory containing items?

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

14

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

man
i.e man mv

15

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

ctrl + a

16

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

ctrl + e

17

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

ctrl + r
press combination again to iterate through previous commands

18

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

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

19

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

head

20

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

tail

21

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

ls -l

22

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

tail -f

23

What are some commands to shutdown/reboot the system?

poweroff
shutdown -r now
halt -r +1

24

What is the command to see who is logged on?

w

25

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

top

26

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

netstat
i.e netstat -tupln

27

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

nano
vi
i.e vi text.txt

28

How doe you use vi?

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

29

What is the command to rename a file or directory?

mv file renamedfile
mv file without specifying location path

30

What is the command to copy a file or directory?

cp

31

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

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