Linux Commands for Non CS Majors

Linux Commands 101 for Non CS Majors.

This blog post is a starting point for non cs majors to learn linux commands in the form of a story.

Meet Danielle, a biomedical engineering student who just started an working on cutting-edge research in a lab that uses Linux ( ubuntu ) for all its technical work. Danielle's mentor, Professor Lin, has assigned her a new project: Setting up a python project to do computations for the experiments they run on the lab..


Danielle is provided a work laptop that runs Ubuntu 22. Her first task is to setup a python project to do some computations for the experiments that they run on their lab.

Danielle here has never used a terminal before. She has to figure it out on her own.

As her first move, she opens the terminal, first instinct -> This is wierd.

She wants to check the location of the current directory and figures out the command for that is :

$ pwd # prints present working directory

Generally on most terminals, the default location is '/home/username/'.

She decides to create a directory named 'lab-metrics'.

$ mkdir lab-metrics
Now she confirms if the folder has been created using the ls command.

$ ls

She navigates into the directory using the cd command.

$ cd lab-metrics

To clear the contents in the terminal she uses the clear command.

$ clear

Before starting to work, she decides to update and upgrade the packages on the system.

sudo apt update -y && apt upgrade -y

She needs an entrypoint python file for the application and can't decide between main.py and app.py, so she decides to create both files for now.

$ touch main.py

To confirm if the file was created successfully, she used to ls command again and there it was.

She needed a couple more files in the root directory, so she used the touch command again, but with multiple file names.

$ touch settings.py config.py .env

She used the ls command again to confirm and could find settings.py and config.py but not .env.

The command did not throw any errors, so she kinda deduced she had to use some flag with the command.

To look into the commands docs, she used man pages.

There she saw she had to use the '-a' flag to view files starting with a '.'.

ls -a

Now the .env file name was displayed.

Her professor had mentioned they'd need to environments :

  1. development
  2. production

She decided to manage it using environment variables in the .env file. She wants add an envirnoment variable to the .env file..

echo "ENV=development" >> .env

Now she needs to verify it, so she uses the cat command

cat .env # prints file contents to stdout

Now she requires a couple directories for structuring her codebase for scalability.

mkdir user_interface db_handler util ecg eeg emg

To make the directories python modules she needs to add an init.py file in each of above created directories. She uses a little trick to create the file in the above directories.

touch {user_interface,db_handler,util,ecg,eeg,emg}/__init__.py

Now she thinks, she wants to change the name of directory 'user_interface' & 'db_handler' to 'ui' & 'db' respectively.

mv user_interface ui
mv db_handler db

To make it more cleaner, she decides to move the settings.py and config.py to the util directory.

mv settings.py ./util/

She made out her mind for the entrypoint and liked app.py, so she decided to remove the main.py from the directory.

$ rm main.py

Her professor mentioned, they won't be working on emg processing for a bit, so she decides to remove that directory for now.

rm -r emg

Thats all for this blog post. The best way to learn linux commands and scripting is to create scenarios for yourself and learn on the go.