Notepad/enter/Coding Tips (Classical)/Terminal Tips/1. Terminals/Shells/Aliases.md

37 lines
1015 B
Markdown
Raw Normal View History

2023-07-05 18:29:11 +00:00
# Aliases
Aliases in your terminal make shortcuts a lot easier when you're typing, use them properly
---
- Setting #1 : default text editor alias since my editor of choice is [BBEdit](obsidian://open?vault=Coding%20Tips&file=Computers%2FMac%20OS%20X%2FBBEdit%2FBBEdit):
``alias bbedit "open -a bbedit"``
then in the terminal type
2023-07-15 04:30:03 +00:00
``bbedit FILE_NAME``
Aliases within your `.bashrc` file is just endlessly useful. This [stackOverflow answer ](https://stackoverflow.com/questions/16199581/open-sublime-text-from-terminal-in-macos/19556342#19556342)gets a lot of it right.
---
### Shebang
This is a command that you often see at the top of the command but you never know what it does. This is used for every single type of Unix-like dydyem and is used to interpet an executable file. It is usually starting with `#!/` and leads to somewhere else.
Example:
```
#!/usr/bin/env sh
Hello World!
```
& you run the executable after `touch` creating one by:
```
chmod +x name_of_the_file
```