Install oh my zsh for cool templates
For MAC, open Terminal and run this command to install:
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Find templates here:
There’s more! Fans have built some more themes here:
To change the theme for your Terminal on Mac:
1. Open .zshrc file. It’s usually in your User directory:
$ cd ~
2. Then open the .zshrc file in the Terminal editor nano:
$ sudo nano .zshrc
3. Find the line that says:
And change the theme name to any name in the Themes list
To use the External Themes, you’ll have to download the .zsh-theme file to be able to use it. Go to the External Themes link above and click the repository where the theme lives. In the repo file list, copy the file with the extension .zsh-theme and store it in your
~/.oh-my-zsh/themes/ folder. Then you can go into
./zshrc and change the theme name to that.
oh my zsh and iTerm2 are great ways to enhance your Terminal. It’s like having a Terminal on steroids!
I have switched to Mac!!!
If you want to add shortcuts to certain directories so that you don’t have to type out the complete file path, you can add it to your .bash_profile file located in your /home directory.
Navigate to home:
$ cd ~
$ vi .bash_profile
This will create a new .bash_profile file if one doesn’t already exist. If one already exists, it will open the file using the vi terminal editor.
alias fcc='cd /Users/username/freecodecamp_projects'
This will allow you to exit the editor.
The ‘w’ stands for ‘write’.
The ‘q’ stands for ‘quit’.
You can also edit your Terminal inside your .bash_profile file and add emojis:
I came across a really simple problem while using my Linux OS. I am used to the CTRL+ALT+DEL in Windows to open the Task Manager to close programs. I wasn’t sure how to do the same in a Linux environment.
To close a program in Linux from the command line, there are two options:
If you don’t know the name of the application, you can use this one. It will prompt you to click on the window of the application you are trying to close.
After clicking on it, the program will immediately close.
$ sudo xkill
If you know the name of the application, you can type:
$ sudo killall <name of application>
$ sudo killall firefox
Download the Sublime package and extract the contents OR follow the steps here to install from your terminal.
Move your extracted contents to the ‘opt’ folder in your terminal:
$ sudo mv Sublime\ Text\ 2 /opt/
Setting up a link:
$ sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime
Test if it worked by typing ‘sublime’ to open the text editor:
A great recommended alternative to the Windows command prompt is Cmder.exe.
Simple to download.
Simple to install.
Get it here: http://cmder.net/
I’ve just installed Vim on Windows 10. I’m completely new to Vim so if you have any great resources for learning, please leave a comment!
Vim is a text editor for your Command Prompt (or Terminal).
To install Vim on your Windows machine, you will have to download the executable file here.
To start up Vim, you can open your Command Prompt and type
- Switch between command mode and insert mode.
- To switch from command mode to insert mode and insert text at the current cursor position, press
- To switch from command mode to insert mode and insert text at the beginning of the line, press
- To switch from command mode to insert mode and insert text at the end of the line, press
- To switch from insert mode back to command mode use
- Opening new lines
- To open a new line after the current one and begin inserting text (switching to insert mode) use
- To open a new line before the current one and begin inserting text (switching to insert mode) use
- Navigating in the source using
- Navigate up a line, press
- Navigate down a line, press
- Navigate left a character, press
- Navigate right a character, press
- To save current edits use
:w (short for write).
- To exit, type
:q (short for quit).
- To save and exit, type
- To force exit without saving, type
- To force save and exit, type
- Copy and paste
- To select a block of a text,
Ctrl + v to switch to the visual mode, then select a block using the directional keys (
- To copy the selected block,
yy (yank line).
- To paste the selected block,
- To paste before cursor,
- Tab complete
- To use tab completion,
CTRL + p.
- Move to beginning and end of a file
- To move to the beginning of the line,
- To move to the end of the line,
- To substitute the character under the cursor, type
r followed by the character you will substitute.
- To switch to replace mode use
Shift + r and start typing.
- Combine operators (like delete) with motions (like end of word)
- As mentioned, Vim commands are composable. So you can combine operations like delete/change/copy with motions like beginning/end of word/line.
- To delete to the end of the word, type
- To delete to the end of the line, type
- To delete the text within quotes, double quotes, parentheses, brackets use
- To copy to the end of the word, type
- You can type a number before the command to execute it multiple times
- To delete 4 lines, type
- Repeat last command by typing
- Jump to specific position in a file.
- To jump to the beginning of a file use
- To jump to the end of a file use
- To jump to the specific line in a file use
8gg (8 is the line number).
- Search forward and backward.
- Match parentheses and brackets.
- To match the current parentheses or bracket use
- Split horizontally and vertically.
- To split the screen horizontally use
- To split the screen vertically use
- Switch between splits.
- To switch to the next split screen use
CTRL + ww.
- Jump forward and backward.
- To jump forward a page use
CTRL + f.
- To jump backward a page use
CTRL + b.
- Modify your environment via dotfiles.
- You can do that after reading this tutorial 🙂 An easy way to edit your
.vimrc file is
- Execute a shell command.
- To execute a shell command simply type
:sh followed by the command.
Here is a cheat sheet for all commands:
This getting started guide by SitePoint provided the above information and goes more in-depth.
How to use UNIX commands in Windows 10:
- Download and install the latest version of Cygwin. (32-bit) or (64-bit)
- Follow the steps in this tutorial if you want detailed instructions about the installation. The installation takes a while, but it’s normal.
- After installation finishes, open your Advanced System Settings in the Control Panel.
- Click the Advanced tab.
- Go to Environment Variables.
- In the second table labeled System Variables, find Path and click Edit.
- Scroll to the end of the Variable Value list and enter the path of your \cygwin\bin\ folder. Remember to close the previous path with a semicolon, so your path should look something like this: ;C:\cygwin\bin\
- Click OK and close all the windows.
- Open your Windows command prompt and type ls -l to test your installation.
- Yay! Now you can use UNIX commands within your command prompt.
I installed this today on my Windows 10 OS and had no problems. Feel free to leave a comment if you are getting errors and I’ll try to help.
If you’re learning coding/programming and haven’t already, you must sign up for a Github account to showcase your work.
Some resources for learning Github:
I did these series of challenges twice. The first time I was completely lost, as it was my first time using the command line on my Windows computer. The second time around, I was able to fully understand every step.
This website is really simple and straightforward. Write down each of the steps listed in this guide to know what order you have to do git commands.
This is a great article that breaks down everything about Github and explains the who, what, when, where, why, and how.