using the command line
cd directory_name
→ change into directory_namecd ..
→ move up to parent directoryls
→ list files and folders in current directoryls -l
→ list each file on it’s own linels -la
→ list the hidden files too!pwd
→ print the path to the working directory../
→ (parent directory), used as part of path to navigate/save one directory up.open .
→ (open working directory), view in Finder.mkdir directory_name
→ create new directory directory_nametouch filename.ext
→ create filemv directory_name_1 directory_name_2
→ move folder into another foldermv filename_1 filename_2
→ rename fileBe careful with these commands the rm
command deletes files in a way that can’t be undone. They don’t go to the trash can!
rm
/rmdir
(remove / remove directory), permanently removes files!rm file_name
→ delete file`rm -rf directory_name’ → delete all children files and directories in directory_name
sudo
(root access), sometimes commands need root access to run. Be careful when using this command!cat
→ displays the contents of a file to the terminalhead -10
→ lists the first ten lines of a filetail -10
→ lists the last ten lines of a fileTAB
(autocomplete), completes command or directory/filename.UP ARROW
(history), toggle through recent commands.CTRL + C
(cancel), stop any task mid process.Use the terminal app to access command line tools.
Mac OS uses the ZSH as the default shell. Oh my ZSH! is a nice package that gives you some great add-ons.
A package manager is software that helps you manage applications installed using the command line. It helps keep tools up to date and allows you to have multiple versions of software installed.
Mac doesn’t ship with a package manager but homebrew is by far the most popular and is really useful. You suggest install it!
The default windows shell, Powershell, is a piece of trash that nobody uses.
You can run a Linux OS on your Windows System using Windows Subsystem for Linux, WSL. This creates a virtual linux system on your machine.