Linux Commands Flashcards

0
Q

cat

A

Print content of file

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

pwd

A

Print working directory.

Show path to where you are.

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

ls

A

List directory contents

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

cp

A

Copy file

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

mv

A

Rename file

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

mv dir/file dir2/file

A

Move file

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

rm

A

Delete (remove) file

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

cd $HOME

A

Change to home directory

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

ls -alrth myfile

A

List metadata

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

touch myfile

A

Create a new file named myfile

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

echo blahblah&raquo_space; myfile

A

Append “blahblah” to myfile

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

rmdir mydir

A

Remove directory (if empty)

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

rmdir -rf mydir

A

Delete directory and everything in it

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

alias xx = ‘some command’

A

Create shortcut for a command

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

mkdir mydir

A

Create a directory

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

$ echo $PATH

A

Show a colon delimited list of directories the OS will look for programs in.

E.g.: /usr/local/bin:/usr/sbin

16
Q

$ env

A

Show the environment variables like $PATH, $LANG, $HOME, $USER, etc.

17
Q

Three ways to change to the home directory

A

cd
cd ~
cd $HOME

18
Q

which git

A

Shows the path in which git will be called from

19
Q

which -a git

A

Shows all paths in which git is installed

20
Q

scp source destination

A

Secure Copy file from one place to another