7 commands to manipulate the most basic files and folders everyone must know

On Windows or Linux operating systems, there are a number of things that users can only do with commands. In the following article, the Network Administrator will introduce you to the 7 most basic commands that any user must 'understand' to perform operations faster.

On Windows or Linux operating systems, there are a number of things that users can only do with commands. In the following article, Network Administrator will introduce you to the 7 most basic Linux commands that any user must 'understand' to perform operations faster.

1. Change directory

Usually to change certain folders you will have to navigate through the directories. However on both Terminal and Command Prompt you can use the cd command to change your current directory to the destination to another folder.

Suppose if you want to access the tech directory, you only need to enter the command:

 cd tech 

Alternatively, you can navigate directly to the tech directory subdirectory, using the command:

 cd tech / sub-folder 

To return to the previous folder or return to the current directory, enter:

 cd . 

2. Create a new folder

7 commands to manipulate the most basic files and folders everyone must know Picture 17 commands to manipulate the most basic files and folders everyone must know Picture 1

mkdir is also one of the commands that users often use. This statement is used to create a new directory with a specific name.

For example, if you want to create a new directory called tech, use the following command:

 mkdir tech 

Also you can create multiple folders at once, for example if you want to create 3 folders named tech, hello and world at the same time, you use the command below:

 mkdir tech hello world 

The mkdir command is compatible with both Terminal and Command Prompt.

3. Create a new file

Use the touch command to create an empty file. Such as:

 touch filename.html 

In addition, you can specify multiple file names to create multiple files at once, such as:

 touch file.html style.css 

4. Move files

Use the mv command to move a specific file to a directory. For example, if you want to move the tech.css file to the directory named / sid, use the following command:

 mv tech.css / sid 

You can also use the mv command to change file names and directories. For example, if you want to rename index.html to about.html, use the following command:

 mv index.html about.html 

5. Copy files

Enter cp command or copy if you want to copy a file or a directory.

For example, if you want to copy index.html and name the new file about.html, use the following command:

 cp index.html about.html 

If you are using Windows operating system, you use the copy command.

6. Display folder contents

Use the List Directory command or the ls command to display the contents of a directory.

The specific name of the directory precedes the ls command to display the contents of the directory.

However, the drawback is that the ls command only works on UNIX Shell. You can run the ls command on Ubuntu and the OS X operating system that cannot run on Windows.

On Windows operating systems you can use the dir command instead.

7. Open the file

Use the open command to open the files of the directory in the default application. For example, to open the Desktop folder on the Finder, use the following command:

 open ~ / Desktop 

Also you can use the open command to open the .txt folder on TextEdit - the default application on OS X operating system to edit Plain text file, you use the following command:

 open readme.txt 

For Windows users, use the edit command. For example:

 edit readme.txt 

Additional:

- Alternatively, you can use the Exit command to exit the Command Prompt window.

- Use ipconfig command to quickly search your IP address.

Refer to some of the following articles:

  1. Common Run commands for Windows you should know
  2. Anyone should know these basic Linux commands
  3. Use the CMD command to remove viruses on Windows computers

Good luck

4 ★ | 1 Vote