Linux Commands & More

Last Updated on March 16, 2025

pip freeze --path python > requirements.txt
Creates a requirements file of all the packages in the path folder

python3 -m venv my_env
Create python environment

source my_env/bin/activate
Activate environment

source ~/.bashrc
reloads the .bashrc file in the current terminal session without needing to restart the terminal

———————

Conda is an open-source, cross-platform, language-agnostic package manager and environment management system designed to solve package management challenges faced by data scientists, particularly those using Python and R

conda create -n my_python_311_env python=3.11 -y
creates a new conda environment, -y automatically answers “yes” to any prompts that might appear during the installation process

conda init
initializes a shell for use with Conda by making changes to your system that are specific and customized for each shell

LAB_BUCKET=`aws s3 ls | grep lab-code | awk '{ print $3 }'`
aws s3 ls Lists all S3 buckets and their creation dates.
grep lab-code Filters the output to include only lines that contain the string “lab-code”
awk supports various operations for advanced text processing and facilitates expressing complex data selections
awk '{ print $3 }' Extracts the third column from the filtered lines, which typically corresponds to the bucket name