Basic Linux Commands

  1. Create a file. 
  1. Remove a file.  
  1. Create a directory. 
  1. Delete a directory. 
  1. Go to previous directory. 
  1. How to create 4 directories (d1—d2—d3–d4) 
  1. Rmdir fails rm-r 
  1. Long list 
  1. What if file name starts 
  1. How to see hidden files 
  1. How to create hidden directory 
  1. Combination of options in ls command 
  1. 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. 

Long list 

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. 

Leave a Comment

MFH IT Solutions (Regd No -LIN : AP-03-46-003-03147775)

Consultation & project support organization.

Contact

MFH IT Solutions (Regd)
NAD Kotha Road, Opp Bashyam School, Butchurajupalem, Jaya Prakash Nagar Visakhapatnam, Andhra Pradesh – 530027