Hello world!
Here is a list of the basic terminal commands you should know by heart.
π - Bookmark the article to save the cheat sheet
And remember to smash that like button β€οΈ and maybe π¦
You absolutely need to read that:
Article No Longer Available
Basics
I love the git bash (I'm on windows) - version 4.4.23
Git Bash emulates a bash environment on windows. It lets you use all git features in command line plus most of standard unix commands.
- 3 basics commands to remember:
Clear: type "clear" / ctrl + l (windows - Linux) / Command + K (Mac)
help - show all comands
help commandName - help about a specific command
ctrl+D or ctrl+C * 2 to exit
Working with Directories:
ls - list / list the contents on your current directory
ls -la - Give more information about the list
pwd - Print Working directory / Print the path to the working directory
cd directory - Change directory / Move between folders - Relative Path (just folders directly contained in the one you are currently)
cd /firstDirectory/secondDirectory/FinalDirectory - Absolute Path (search a directory anywhere in pc)
cd .. - Go back a directory
cd ~ - return to the home directory
mkdir - make directory / create a new directory+
mkdir -v - Make directory + add lines that say you created a directory
touch - Create a file (or multiple) or "touch", change a file (update when it was last modified)
rm - Remove / Delete a File (forever)
rm -rf - Remove recursive force / Delete a directory add all file nested in the directory (also other directories)
rmdir - remove a directory (only work on empty folders)
More readable way:
Basic commands:
Write: help
to access
Git available commands:
Write: git --help
to access
Write: git help -g
to access
Extra: Writing
git help git
the command line redirect you to a download with all the git bash available commands in a more readable wayType
git help -a
to have access to a more advanced line by line commands description - Write q to exit
Hope this helped!
And remember to smash that like button β€οΈ and maybe π¦
You added:
# opens .zprofile for editing (zsh profile)
alias prof='nano /<<ROOTDIRECTORYHERE>>/.zprofile'
# opens .zshrc for editing
alias rc='nano /<<ROOTDIRECTORYHERE>>/.zshrc'
# source profiles (should be done every time after changing profile)
alias s='source /<<ROOTDIRECTORYHERE>>/.zprofile; source /<<ROOTDIRECTORYHERE>>/.zshrc;'
# fancy ls
alias lk='ls -lhkart'
# for 'lk' typos ;)
alias kl='ls -lhkart'
# open current folder in GUI
alias show='open .'
# go back a folder
alias back='cd ..'
# previous folder
alias prev='cd -'
# cd with no arguments brings you to your root folder :)
alias home='cd'
cd (without args)
- Return to the home directory
pushd and popd.
The pushd command saves the current working directory in memory so it can be returned to at any time, pushd moves to the parent directory. The popd command returns to the path at the top of the directory stack.[5][6] This directory stack is accessed by the command dirs in Unix or Get-Location -stack in Windows PowerShell.
Learn more
Other articles:
Article No Longer Available
Article No Longer Available
Article No Longer Available
Subscribe to my Newsletter!
A loooong, and fun, weekly recap for you
Free PDF version of my articles
Highly customizable inbox
That's --> free <-- and you help me!
Top comments (7)
These are quite useful.
Also, don't forget that TAB usually helps.
π for
cd -
Brings you to the previous location you were at :)
I always keep these alias with me on all machines, local and remote:
π
Thanks, I'll add the list in the cheat sheet!
If you'd like to go ahead and get a workflow to use with this
dev.to/barelyhuman/my-git-workflow...
also, if you use zsh with zsh-suggestions setup, it'll reduce you the time of re-writing frequent commands.
You can find the setup instructions here
stepone
PS never use rm -rf in bigger directories directly.
Like C:>
Iβd add cd (without args), pushd and popd.
Also, just a list of built-ins is not that helpful. I mean, man bash (or help, or whatevs) gives you the same. Maybe extract the most useful?
These commands are quite useful. Any developer would find this quite useful !