Two years ago, when I first started learning to code, I found myself intimidated of the command line. This is something that I feel a lot of beginn...
For further actions, you may consider blocking this person and/or reporting abuse
Great post :)
It's worth mentioning that you can create several nested directories with -p this way:
mkdir -p /dir1/dir2/dir3
Also, for creating multiple files you can use the following syntax:
touch file{1..3} which will create file1 file2 and file3
Thank you so much for adding these to the discussion!! I was not aware of these two little tricks.
Something super useful but not widely known, is " cd - "
// ~/
$ cd docks/proj/src/component
// ~/docks/proj/src/component
$ (something useful)
// ~/
$ cd -
Also, just "cd" is same as "cd ~" which brings you to the home dir.✔️
As I stated in the other comment, I had no idea
cd -
was a thing before reading the discussion. I can think of multiple different times I accidentallycd
ed somewhere when I didn't want to and had to type everything out again. This is going to be a nice time saver!Great intro, I will definitely share this when asked.
TIL you can
cd -
to go backI had no idea this existed! This is awesome. Thank you for sharing.
Yeah I literally looked it up today.
There's
pushd
andpopd
also, but I wanted something that works like the back button even if I hadnt pushed.Google brought me to unix.stackexchange.com/questions/8...
One of my favourite aliases is hi=history | grep
makes it super easy to get the commands I know have a certain string, be it the name of the command, a substring of a hostname or an argument to a command.
You can also use ! to execute specific command from the history list like !1986 where 1986 is the command ID Using history with grep and !
I'm planning on covering aliases in another blog post for this series! They are actually something relatively new to me, so thank you for introducing this one to me and adding to the discussion.
Thank you for the article, Victoria. You and those who read this article might benefit from explainshell, a website where you can enter a shell command (with optional arguments) and it will explain to you what everything means.
Try it out by entering some command with arguments. :)
That link is absolutely amazing! I wish I would have known about it earlier. I'm going to edit the article and add it. Thank you so much for adding this to the discussion.
cd
andls
are by far the two commands I use the most, especiallyls -la
Excelent introduction to cmd