Alias one thing to another thing.
> alias hello="echo hello"> hellohello
If you save this line in your
hello will be
available in all new terminal sessions. To make it available in your current
session too, see Sourcing changes to rc files
List the files in the current directory.
You can install
exa for a modern replacement:
brew install exa
exa so that I always use
exa. You can do the same by adding
the following to your
You'll also need to
source the changes to the file
if you want the alias to work in your current terminal.
change directory. Changes your directory to a different one.
~> cd code~/code>
If you type part of a file or directory name and press tab, you'll trigger autocomplete which will attempt to find to expand your current input to the first matched filename.
> lsa_file b_file> ls a<tab># hitting tab there replaces the input line with:> ls a_file
If you use
zsh, you can use tab to complete nested partial matches:
> ls -T.└── site└── src└── pages├── api│ └── hello.ts└── index.tsx> ls s/s/p/a/h[tab]# hitting tab there replaces the input line with:> ls site/src/pages/api/hello.ts
present working directory aka "where am I?". Shows your current location in the file system.
Shows you what/where the target command is.
> which lsls: aliased to exa> which exa/opt/homebrew/bin/exa
Creates a directory in the current directory.
> mkdir new-directory
Kind of sucks by default because it can't create nested directories:
> mkdir some/nested/directorymkdir: some/nested: No such file or directory
However it has this nice little flag
-p that makes it handle nested
directories. I think that should be the default option, so I made it that way on
my local system:
> alias mkdir="mkdir -p"> mkdir some/nested/directory
Create an empty file.
> touch some_file
Remove the target file/directory.
# files:> rm some_file# directories:# we need `-r` flag (recursive) for directories + `-f` flag (force) to delete# all files/directories under the target without asking for confirmation> rm -rf some_directory
If you've modified your
.bashrc file and want to see changes in the
source .zshrc or
I'll write this at some point. Encourage me to write it on Twitter!