Basic UNIX commands
Jérémy Levron
Posted on September 12, 2017
Lately, I started learning commands lines. I mean, I used npm install
or gulp
, but no more.
So I started using commands lines and I have to say that I like it. A lot.
I wanted to share with you what I learned.
cd
The cd
command is used to change the current directory.
cd stand for change directory
cd path/of/directory
To move up by one directory you can hit
cd ..
Source
ls
The ls
command list all files of a type other than directory, found in the current directory.
ls stand for list segments
ls
man
The man
command display the online manual pages. We can specify a section as parameter. The section is normally the command, function or file name.
man stand for manual.
man name_of_command
To exit the manual you can hit
q
,:q
,Q
,:Q
orZZ
.
mkdir
The mkdir
command is used to create a new directory. The directory would be create in the current directory.
mkdir stand for make directories.
mkdir name_of_directory
rmdir
The rmdir
command is used to remove an empty directory.
rmdir stand for remove directories.
rmdir name_of_directory
We can pass an -p
option. In this case each directory argument will be treated as a single path and will be removed if they are empty.
rmdir -p name/of/directory
mv
The mv
command is used to move a file into a given directory.
mv stand for move.
mv name_of_file name/of/directory/destination/
open
The open
command is used to open a file or a directory
open name_of_file
I know, it's very basic, but you have to start somewhere. 😅
I created a Gist where I add what I learn.
And you, what are your favorite commands?
Posted on September 12, 2017
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.