If there are several repetitive tasks you do each day on your Mac, or in Linux, why don’t you put them into a function in your profile so you don’t have to constantly type out the same commands.
I had this before when I used to upload scripts and files to my repo that I store on AWS. As there were so many files and changes, I put this into a function inside my .bash_profile. This way I can easily type the function name, pass two parameters and then all the hard typing is done for me.
So instead of typing out the following commands all the time, this goes down to three. The original code was
scp -i "/Users/craigdba/Downloads/test.pem" script_name ec2-user@1.1.1.1:/home/ec2-user/repo/python/
There are a few directories I upload to, depending on what script I am writing or editing, could be bash, python, perl or a function, so I made this into an argument to be passed, this was the second argument.
The first argument was the script name that will be uploaded.
So to create these functions, edit your ~/.bash_profile, and place them in there, you can see mine below.
upload_to_repo() { scp -i "/Users/craigdba/Downloads/test.pem" $1 ec2-user@1.1.1.1:/home/ec2-user/repo/$2/ }
Once you save the file, open another terminal window and you function is now ready to use. So now when I want to upload a file, i just type.
upload_to_repo test.py python
So now that file gets uploaded automatically to the Python directory, much easier and don’t have to worry about remembering the difficult string.