Member-only story

Never Forget Your Commands Again: Utilizing a .profile

Nessim Btesh
2 min readJan 17, 2023

Keeping a consistent set of commands in every project can be a tedious task, especially when working on multiple projects simultaneously. However, by utilizing a “.profile” file and adding a specific command to your “.bash_profile”, you can easily ensure that you never forget your commands and keep them organized.

A “.profile” file is a script file that is executed when a user logs into the system. It can be used to set environment variables, configure shell settings, and execute commands. In this case, we will use it to store all of the commands that are specific to a particular project.

To create a “.profile” file in a project, simply open a terminal and navigate to the project’s root directory. Then, create a new file with the name “.profile” and add the commands that you want to execute. For example, if you frequently use the AWS SAM Build or AWS SAM Logs commands, you could add the following to your “.profile” file:

alias build="sam build --use-container --template template.yaml --skip-pull-image"
alias logs="sam logs --region us-east-1 -n NAME_OF_FUNCTION --stack-name STACK_NAME -s '1days ago' --tail"

These commands will add the a behavior of the “build” and “logs” commands to include additional options.

--

--

No responses yet