Mastering WSL Flashcards

1
Q

What command will print the working directory?

A

pwd

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

What command is needed to list a directory’s content?

A

ls

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

How do I get a detailed list of a directory’s contents?

A

ls -l

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

What command will show hidden files in a directory?

A

ls -a

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

What command will get you instantly to the home directory?

A

cd ~

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

What command will let you make a new directory?

A

mkdir name

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

What command will create an empty file?

A

touch file_name

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

What command will let you move or rename a file?

A

mv source destination

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

How do you delete a file?

A

rm file_name

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

How do you delete a directory and its contents?

A

rm -r directory_name

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

How do you view a file’s contents from the wsl terminal?

A

cat file_name

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

How do you edit files from within a wsl terminal?

A

nano file_name

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

How do you display your username in wsl?

A

whoami

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

How do you show the computer’s system information?

A

uname -a

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

What command will refresh package lists?

A

sudo apt update

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

How do you install updates?

A

sudo apt upgrade

17
Q

What commands will install and remove specific packages?

A

> sudo apt install package_name

> sudo apt remove package_name

18
Q

How do you search for a specific file?

A

Use the find function. For example:

find . -name “.txt

19
Q

What are some useful compiler flags for FORTRAN programs within wsl?

A

-Wall – Show all warnings (useful for debugging).

-O3 – Optimize for speed.

-g – Include debugging information.

-fcheck=all – Enable runtime checks (like array bounds).

-fopenmp – Enable OpenMP for parallel computing.

20
Q

How do you compile a FORTRAN program with debuging symbols?

A

gfortran -g program.f90 -o program

gdb ./program

21
Q

What are the different types of Linux shells?

A
  1. Bash (bourne again shell - most popular, usually the default.)
  2. Zsh (Z shell - extended version of bash with more plugins and themes)
  3. Ksh (Korn Shell - good for scripting)
  4. Fish (Friendly interactive shell)
22
Q

From a wsl terminal, what is the command that lets you know what type of shell you are running?

A

echo $0

or

echo $SHELL