Command | Description |
---|---|
cd |
change directory |
cd .. |
change directory one level back |
ls |
list contents of directory |
pwd |
print working directory |
mkdir foldername |
create a folder named foldername |
touch dandelion.txt |
create a file named dandelion.txt |
echo "woof woof" > kitty.txt |
creates a text file called kitty.txt that contains the words, "woof woof" |
cat filename.txt |
print contents of file |
atom filename.txt |
Opens file in atom (this is why we installed the shell commands!) |
source ~/.bash_profile |
(macOS) restart your terminal config file |
source ~/.bashrc |
(Windows) restart your terminal config file |
rm -rf filename.txt . |
remove a file or folder this way (BE CAREFUL TO NOT DELETE ANYTHING UNINTENDED |
mv filename.txt newfilename.txt |
rename a file |
open . |
(macOS) open the current folder in Finder |
explorer . |
(Windows) open the current folder in Explorer |
open filename.txt |
(macOS) opens file in Text Edit |
notepad.exe filename.txt |
(Windows) opens file in Notepad |
cp filename.txt filename2.txt |
copy file |
say "hello, what is poetic computation?" |
(macOS) speak out loud |
https://superuser.com/questions/223913/os-x-say-command-for-windows | (Windows) speak text out loud |
man cd |
show the manual for 'cd'. Press q to quit |
curl wttr.in |
check the weather in our local locations!⛅️🌧🌈 |
Command | Description |
---|---|
Up + Down Arrow keys | scroll through history |
Tab Key | autocomplete |
CMD + CTRL + SPACE | Emoji Keyboard (Mac OS) 🍒🦋💌🥬 |
command | Description |
---|---|
echo "woof woof" > kitty.txt |
creates a text file called kitty.txt that contains the words, "woof woof" |
nano textfile.txt |
open file in the nano text editor |
CTRL + X , y , ENTER | exit and save changes |
- In these steps, we are using terminal and nano to open and edit a file called ~./bash_profile
- In steps 2-4, the lines of code are meant to be pasted into nano when editing the ~./bash_profile
- In the other steps, the commands are entered in terminal
The ~./bash_profile or ~./bashrc is a configuration file for the terminal.
First make sure you are running bash instead of zsh by running this command:
chsh -s /bin/bash
You can use an editor called nano that is built into terminal instead of using a separate editor like vs code
-
Macs:
- Nano:
nano ~/.bash_profile
- Vs code:
code ~/.bash_profile
- Nano:
-
Windows:
nano ~/.bashrc
- This command will open your ~./bashrc in nano
Remember to reboot your terminal
Mac:source ~/.bash_profile
Windows: source ~/.bashrc
OR close and reopen terminal : )
OR if you created an alias for this, enter sp
(short for source profile) : )