- Create a file.
- Remove a file.
- Create a directory.
- Delete a directory.
- Go to previous directory.
- How to create 4 directories (d1—d2—d3–d4)
- Rmdir fails rm-r
- Long list
- What if file name starts
- How to see hidden files
- How to create hidden directory
- Combination of options in ls command
- How to copy a file
First, we need to check the linux command PWD it was Present working Directory
Create a file.
We use the command to create the file in Linux it was Cat > F1, Cat >F2, after that if you want come out from the file use the command as ctrl+D, when we see the file of the content, we use the command as Cat F1
Remove a file.
If we need to remove any file Just type the RM file name, ex: RM F1, RM F2 it will automatically be deleted. Support we need to see the list of files just type LS & hit enter. It will show all the files.
Create a directory.
We use the command to create the directory as Mkdir D1, Mkdir D2. How to find directories & files difference directories are always in blue colour and files are in white colour
Delete a directory.
We use the command to delete the directory as Rmdir d2 when it was empty it was directly deleted,
When we want see the current working directory, we use command as PWD. If we want to change the directory use command ad CD directory name, CD D1.
Go to previous directory.
We use the command to go previous directory CD ..
Rmdir fails rm-r
We use the command to remove directory force Rmdir –r d1.
How to create 4 directories (d1—d2—d3–d4)
These are the Nested directories; we need to create the directory using the command mkdir d1, cd d1 – mkdir d2, cd d2 – mkdir d3, cd d3 – mkdir d4, cd d4 at last we need to hit the command PWD it shows the present working directory.
Suppose we need to jump from one directory to another directory use the command as cd /home /ubuntu. We need to create the empty files use the command as Touch f1/f2.
We use the command as ls –l it will show the list of files & date, time byte size.
What if file name starts
We use command as touch. f1 this will not show in main list.
How to see hidden files
We use command as ls –a to see all hidden files. When it starts with .file name/. directory name all are hidden.
How to copy a file.
We use command as CP F1 F9 it will copy all one file to another file.