This article will be accompanied by the following github repository which will contain all the commands listed as well as folders that demonstrate before and after usage!
The readme for this git repo will provide a much more condensed list… whereas this article will break up the commands with explanations… images & links!
pwd
:
pwd
command.
ls
:
ls
command in your CLI.
ls
command i.e. ls directory_name
.
ls
command options:-
mkdir
:
mkdir
command. To use it type mkdir folder_name
.
cd
:
cd directory_name
.
..
:
cd
command to change directory but if we
want to move back or want to move to the
parent directory we can use a special
symbol ..
after cd
command, like cd ..
touch
:
touch file_name
. It's going to create a new file
in the current directory (the directory
you are currently in) with your provided
name.
cat
:
cat
command. To use it type cat file_name
.
mv
:
mv
command.
mv file_to_move
destination_directory
, you can move a file to the specified
directory.
mv directory_to_move
destination_directory
, you can move all the files and
directories under that directory.
mkdir html css touch bye.txt
mv
:
mv
command can also be used to rename a
file and a directory.
mv old_file_name new_file_name
& also rename a directory by typing mv old_directory_name
new_directory_name
.
cp
:
cp
command.
cp file_to_copy
new_file_name
.
-r
option, like cp -r directory_to_copy
new_directory_name
.
-r
option for "recursive" means
that it will copy all of the files
including the files inside of
subfolders.
rm
:
rm
command.
rm file_to_remove
.
rm -r directory_to_remove
.
clear
:
~
:
~
. The Home directory refers to the base
directory for the user. If we want to
move to the Home directory we can use cd ~
command. Or we can only use cd
command.
…..below is the terminal output for the following commands:
After printing the working directory for good measure:
The above command deletes empty files recursively starting from the directory in which it was run:
The command seen below deletes empty folders recursively starting from the directory in which it was run:
The resulting directories….
The command seen below deletes .git folders as well as .gitignore, .gitattributes, .gitmodule files
here is a link to and photo of the resulting html file:
The result is :
I am essentially removing the recursive action of the find command…