Basic Commands Flashcards

To learn basic unix commands

1
Q

list files and directories

A

ls

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

list all files and directories

A

ls -a

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

make a directory

A

mkdir

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

change to named directory

A

cd directory_name

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

change to home-directory

A

cd or cd ~

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

change to parent directory

A

cd ..

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

display the path of the current directory

A

pwd

stands for: Print Working Directory

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

copy file1 and call it file2

A

cp file1 file2

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

move or rename file1 to file2

A

mv file1 file2

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

remove a file

A

rm filename

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

remove a directory

A

rmdir directoryname

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

display a file

A

cat filename

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

display a file a page at a time

A

less filename

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

displat the first few lines of a file

A

head filename

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

display the last few lines of a file

A

tail filename

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

search a file for keywords

A

grep ‘keyword’ filename

16
Q

count number of lines/words/characters in file

A

wc filename

17
Q

redirect standard output to a file

A

command > file

18
Q

append standard output to a file

A

command&raquo_space; file

19
Q

redirect standard input from a file

A

command < file

20
Q

pipe the output of command1 to the input of command2

A

command1 | command2

21
Q

concatenate file1 and file2 to file0

A

cat file1 file2 > file0

22
Q

sort data

A

sort

23
Q

list users currently logged in

A

who