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
-
Macs:
nano ~/.bash_profile
- This command will open your ~./bash_profile in nano
-
Windows:
nano ~/.bashrc
- This command will open your ~./bashrc in nano
In steps 2 and 3 we will paste the following aliases AKA shortcuts in nano that will help us visualize our folder poem structures.
-
export PS1="π \w\n\u$ "
- This will customize your Bash prompt. Feel free to change the emoji. (skip if you use zshell)
- Explanation:
\w
shows your full file path so you'll always know where you are in the terminal,\n
creates a new line in your bash prompt.\u
shows your computer username, and$
symoolizes the end of a bash prompt.
-
alias oldtree="find . -not -path '*/\.*' -print | sed -e 's;[^/]*/;|;g;s;|; |;g'"
- (if you have homebrew installed enter
brew install tree
in another terminal window instead) - this will add a command you can use that will tree your poems in a more lo-fi way than the tree command we installed with homebrew
- (if you have homebrew installed enter
-
alias treefile="find . -not -path '*/\.*' | xargs -I {} bash -c 'f={}; echo \$f | sed -e \"s;[^/]*/;|;g;s;|; |;g\"; if [[ \$f == *.txt ]]; then echo; cat \$f; echo; echo; fi'"
- this will add a command you can use that will tree out the contents of your text files along with the folder structure.
-
Reboot your terminal
Mac:source ~/.bash_profile
Windows: source ~/.bashrc
OR close and reopen terminal : )