0% found this document useful (0 votes)
11 views

Basic Linux Command

The document discusses basic Linux commands like pwd, cd, ls, mkdir, rmdir, touch, cp, mv, rm, cat, and echo. It provides examples of how to use each command, explaining what they do and their basic syntax and usage.

Uploaded by

BHANU NAGPURE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Basic Linux Command

The document discusses basic Linux commands like pwd, cd, ls, mkdir, rmdir, touch, cp, mv, rm, cat, and echo. It provides examples of how to use each command, explaining what they do and their basic syntax and usage.

Uploaded by

BHANU NAGPURE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#Introduction

Linux is a powerful operating system with a command-line interface that


provides a lot of flexibility and control. In this tutorial, we will cover some of
the basic Linux commands that are essential to get started with using Linux.

#Basic Commands

pwd: Print the current working directory


cd: Change the current directory
ls: List the contents of the current directory
mkdir: Create a new directory
rmdir: Remove a directory (if it's empty)
touch: Create an empty file or update the timestamp of an existing file
cp: Copy files and directories
mv: Move files and directories
rm: Remove files and directories
cat: View the contents of a file
echo: Print a message to the screen

#Command Usage
Each command has a specific syntax and usage. Here are some examples:

pwd: Simply type "pwd" and press enter to display the current working
directory.
cd: To change to a new directory, type "cd" followed by the directory path. For
example, "cd /home/user/documents" will take you to the "documents" directory in
the "user" home directory.

ls: Type "ls" to list the contents of the current directory. You can add
options to the command to modify its behavior, for example "ls -l" to display a
detailed list of the contents.

mkdir: To create a new directory, type "mkdir" followed by the directory name.
For example, "mkdir mydirectory" will create a new directory called "mydirectory"
in the current working directory.

rmdir: To remove an empty directory, type "rmdir" followed by the directory


name. For example, "rmdir mydirectory" will remove the "mydirectory" directory if
it is empty.

touch: To create a new file, type "touch" followed by the file name. For
example, "touch myfile.txt" will create a new empty file called "myfile.txt" in the
current working directory. To update the timestamp of an existing file, simply type
"touch" followed by the file name.

cp: To copy a file or directory, type "cp" followed by the source file or
directory and the destination. For example, "cp myfile.txt /home/user/documents"
will copy the file "myfile.txt" to the "documents" directory in the "user" home
directory. You can also use options to modify the behavior of the command.

mv: To move a file or directory, type "mv" followed by the source file or
directory and the destination. For example, "mv myfile.txt /home/user/documents"
will move the file "myfile.txt" to the "documents" directory in the "user" home
directory. You can also use options to modify the behavior of the command.

rm: To remove a file or directory, type "rm" followed by the file or directory
name. For example, "rm myfile.txt" will remove the file "myfile.txt". You can also
use options to modify the behavior of the command, such as "-r" to recursively
remove a directory and its contents.

cat: To view the contents of a file, type "cat" followed by the file name. For
example, "cat myfile.txt" will display the contents of the file "myfile.txt" on the
screen.

echo: To print a message to the screen, type "echo" followed by the message.
For example, "echo Hello, World!" will print the message "Hello, World!" to the
screen.

#Conclusion

These are some of the basic Linux commands that you will find useful when
getting started with Linux

You might also like