Table of Contents
7 Commands to Manipulate the Most Basic Files and Folders is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
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
typically 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

mkdir is also one of the commands that users often use. This statement helps create a new directory with a specific name.
As an 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, As an 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. As an 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. As an 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.
As an 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. As an 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. As an 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:
- Common Run commands for Windows you should know
- Anyone should know these basic Linux commands
- Use the CMD command to remove viruses on Windows computers
Good luck
FAQ
What should you know about 1. Change directory?
Typically 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.
What should you know about 3. Create a new file?
Use the touch command to create an empty file. Such as:
What should you know about 4. Move files?
Use the mv command to move a specific file to a directory. As an example,, if you want to move the tech.css file to the directory named / sid, use the following command:
Reader Comments 0
Sign in with email or Google to join the discussion.