You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print working directory returns where you are in the file system
pwd
Use this anywhere to show where you are in the file system
ls
ls lists the contents of the directory you are in. Directory is the same as folder
ls
Use ls -a to show "hidden" files and directories (those that start with a period like ".config")
cd
change directory allows you to go to a different folder. cd my_folder goes from your current folder into the subfolder called "my_folder". Just entering cd will take you back to the home directory (~)!
Use mv to rename a file or move it to a different directory
cp
copy a file.
cp foo.txt my_folder/foo.txt
Use cp -r to copy a directory
rm
remove a file.
rm foo.txt
Use rm -r to remove a directory
mkdir
make directory.
mkdir my_folder
Use mkdir -p to make a directory and any parent directories that don't exist
rmdir
remove directory.
rmdir my_folder
Use rmdir -p to remove a directory and any parent directories that are empty
touch
creates an empty file
touch foo.txt
cat
catenate and print files.
cat foo.txt
Use cat to print the contents of a file to the terminal
Text Editors 📝
Command
Description
Example
Notes
nano
a simple terminal text editor
nano foo.txt
vim
a more advanced terminal text editor
vim foo.txt
File Permissions 🔒
Command
Description
Example
Notes
chmod
change mode of a file or directory
chmod +x foo.txt to allow the file to be executed
Use chmod to change the permissions of a file or directory
chown
change owner of a file or directory
chown user:group foo.txt
Use chown to change the owner of a file or directory
Conda 🐍
Command
Description
Example
Notes
conda create
create a new conda environment
conda create -n my_env python=3.8
conda activate
activate a conda environment
conda activate my_env
conda deactivate
deactivate the current conda environment
conda deactivate
conda list
list all packages in the current conda environment
conda list
conda install
install a package into the current conda environment
conda install numpy -c anaconda
Specify the "channel" you use with the -c flag. Find the channel why youf search it. E.g., searching "numpy conda" will show that numpy is from the anaconda channel
conda remove
remove a package from the current conda environment
conda remove numpy
mamba install
a faster alternative to conda install
mamba install numpy
Please install mamba as one of the first things you install and then use mamba install instead of conda install