Command Line Tips

I am not very experienced in the use of the command line but I have been impressed by what you can do with it. I also like coming across command line tips and tricks that make life easier and more fun. I will fill this page with the ones I like best.

Tab Completion

If any of your folder names contain spaces (let’s say you have named a folder “Proposal Writing”) you can use the tab button after pressing the first few characters.
This will then “fill in” the rest of the folder name for you. For example, type

cd ~/Docu TAB fills in cd ~/Documents/
hit ENTER then type cd Pr TAB
and it will fill in the rest to take you to ~/Documents/Proposal\ Writing/
then hit ENTER and you will be in your “Proposal Writing” folder.

Note: When searching for a file in Spacemacs (with SPC f f for example) continue typing the path and use TAB for auto-completion.

StackExchange is a good place to find tips like this:

You can use alias to speed navigation

alias wdoc='cd ~/Documents/PhD/docs'

Tom Ryder has a few more navigation tips here

A very convenient way of making navigation easier is provided by autojump.

Here is a page of Mac specific tricks for the command line.

Mitchell Cohen listed eight very handy command line utilities and followed up with more

There are also some fun geeky things you can do with the command line.

If you don’t like autojump, Jeroen Janssens has a nifty hack for bookmarking folders/directories so that you can jump to them easily.

This Bash guide is reputed to be the best.

I use iTerm2 as a Terminal replacement on my Mac. It has a lot of cool features.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.