Command | Description | ls | Lists directories and files visible under the present working directory. |
---|---|
ls -R | List files in sub-directories of the present working directory. |
ls -a | Lists all hidden files in the present working directory. |
ls -al | Gives a detailed list of displayed files and directories with extra information such as size, permission, owner, etc. |
cd or cd ~ | Takes you to the Home directory of your Linux operating system. |
cd .. | Navigates you backwards to the parent directory of the current directory you are under. |
cd | Navigates to a target directory under the present working directory, for example, cd Downloads. |
cd / | Takes you to the root directory of your Linux operating system. |
cat > filename | Creates a file called filename. |
cat filename | Displays the contents of a file called filename. |
cat file_1 file_2 > file_3 | |
mv file_random “defined file path” | Moves the file called file_random to the target file path or destination you will define. |
mv file_name new_filename | Renames the file called file_name to a new file name called new_filename. |
sudo | A command used by sudoer users to execute privileged commands applicable to a root user or superuser. |
rm filename | |
man | Use it with a Linux command you do not understand to get help on how to use that command effectively. |
mail -s “mail_subject” to-mail_address < attachment_filename | Sends an email from the terminal, along with an attachment. |
In today's world of cloud computing and virtualization, understanding the basics of Linux can help you work more efficiently. Whether you're a developer, sysadmin, or simply someone who wants to learn more about computers, knowing simple Linux commands is essential.
Command | Description |
---|---|
cd ~ |
Navigates to the user's home directory. |
pwd |
Displays the current working directory. |
ls -l |
Lists files and directories in a long format, showing permissions, ownership, and timestamps. |
mkdir mydir |
Creates a new directory named "mydir" in the current directory. |
Linux has many commands for managing files and directories. Here are some essential ones:
cp file1.txt file2.txt
Copies the contents of "file1.txt" to a new file named "file2.txt."mv file.txt new-location/
Moves or renames "file.txt" to a new location.rmdir mydir
Deletes an empty directory named "mydir."In this article, we've covered some of the most essential simple Linux commands. Mastering these will help you navigate and manage files on your Linux system like a pro.
In this article, we will explore some basic yet essential Linux commands that every beginner should know.
Linux provides several commands to navigate through your file system:
Command | Description |
---|---|
cd |
Change directory. Use it to move between directories. |
pwd |
Print working directory. Displays your current directory. |
ls |
List files and directories in the current directory. |
mkdir |
Make a new directory. Create a new folder. |
rmdir |
Remove directory. Delete an empty folder. |
Here are some code samples to help you understand these commands better:
$ cd Documents $ pwd /home/user/Documents $ ls -l total 8 -rw-r--r-- 1 user user 0 Oct 21 14:47 file1.txt $ mkdir test $ rmdir test
Linux provides several commands to manage files:
Command | Description |
---|---|
cp |
Copy file. Create a copy of an existing file. |
mv |
Move or rename file. Move a file to another location or rename it. |
rm |
Remove file. Delete an existing file. |
touch |
Create a new empty file. Create a new, blank file. |
Here are some code samples to help you understand these commands better:
$ cp file1.txt file2.txt $ mv file2.txt Documents/ $ rm file1.txt $ touch newfile.txt
Linux provides a vast array of simple yet powerful commands that can be used to navigate, manage files and directories. Understanding these basic Linux commands is essential for any beginner looking to explore the world of Linux.