If you're new to Linux, using the terminal to manage folders, files, and software might seem hard at first. But with a few basic commands, it becomes easy and powerful.
In this guide, we will show you simple Linux commands to help you create folders, view files, edit documents, and more. These steps are great for beginners or anyone looking to learn how to use Linux in a simple way.
Make a Directory or Folder
mkdir myFolder
View directory contents:
ls
: Lists all files and directories in the current directory.Example:
ls /home
shows files in the/home
directory.
Change directory:
cd <directory_path>
: Changes to a different directory.Example:
cd /home/user/Documents
moves you to the Documents directory.
Create a file:
* touch filename
: Creates an empty file.
* Example: touch myfile.txt
creates an empty file called myfile.txt
.
Edit a file:
nano filename
: Opens a file in thenano
text editor.Example:
nano myfile.txt
lets you editmyfile.txt
.
click ctrl + O to save
Press Enter to confirm the file name and save.
To exit Nano after saving, press
Ctrl + X
.
Delete a file:
* rm filename
: Deletes a file.
* Example: rm myfile.txt
deletes myfile.txt
.
Install software
(on Ubuntu/Debian-based systems):
* sudo apt install <package_name>
: Installs a program.
* Example: sudo apt install git
installs Git or sudo yum install git
. please refer to this https://software-engineer.thirdygayares.com/package-manager-in-linux
To check storage usage and available space in Linux, you can use the following command:
* df -h
: Displays disk space usage in a human-readable format (GB, MB, etc.).
Example: