shows the current directory that you are in
list the items which are in the current direcory
simply type
cdto go back to root foldercd ..to go up one hierachy level
to make your terminal line looks cleaner, and go back to the top, but when you scroll up the terminal, you can still see the previous commands that you have used.
Type the first letter of the folder that you want to go into, then press tab, the terminal will show all the possible folders or auto complete the name of the folder
example: mkdir hello will create a new folder called hello in the current directory
touch command will touch the existing files and change the date when these files were changed the last time, but when the command cannot find the specific file, it will create anew one.
We are basically misuing this command, but this is a way of creating a new files within your file system.
example: touch world.js
This command delete files permanently, keep this in mind, as you will not be able to restore the file from the bin.
example: rm world.js
Same as rm, this command delete the folder permanently.
And take note that this command delete folder instead of files.
Example: rmdir hello
Take Note
You cannot remove a folder which contains files within it. You will need to remove the files then only you can delete the folder
Flags allow users to modify the command and are sometimes called as options. They normally start with a - after a command
ls -s shows the files and the file size
ls -l shows print the files exist in the current directory in long format, including time created, creator etc
ls -ls shows the files in long format as well as the file size
type man [command] to find out what are the flags available for a specific command
Example: man mkdir
With the flag r, users can remove the folders which are not empty. However, do take note of this, as it might cause you huge problems when you delete the whole folder with all the data inside.
YOU WONT BE ABLE TO RETREIVE BACK THE DELETED DATA
This command helps to copy a files into another folder, it requires two path, one for source files another for target folder.
Example: cp data/index.css copied/
The above example copied the a file index.css from the folder called data into another folder called copied
Example: cp -r data/ copied/
The above example will copy all the files in the data folder into the copied folder.
Take note of the slashes, without the slashes, the command will create a new directory in the copied folder instead. And always remember to type the target source, if not, it will delete the source folder instead
The principle is basically same as copy except that t
his command merely moves the files around instead of copy the files
You can also move the whole folder instead of a single files
The above command renames the file indexs.css into index.css
