Shell Scripting Lesson 1 - Basic Shell Commands

Shell scripts contain with series of shell commands. shell scripts are used to get user inputs from users. Mostly shell Scripts are used to gather system information and automate tasks in day today life.
In this set of tutorials, I am going to teach you shell scripting from A to Z.

Before Start the shell scripting tutorial course, we should know some useful basic shell commands because these commands are mostly uses in this course.


I have mentioned Some basic shell commands below. Follow these shell commands before the course.


1. ls  - List the files in a directory.
ls -l   # show information about the files in a directory


2. cat  - View the content of a file
cat filename # view the content of a file

3.  cd  - Change the current working Directory.
cd /etc/init.d   # go to /etc/init.d directory

4. cp  - This command is used to copy files.
cp source_file destination_directory  # copy source_file to destination_directory.
Ex :  cp  text_file /home/     # copy text_file  tohome directory

5. man Command - Show  help of a command.
man grep     # get help manual of grep Command

6. mv - Command for move file(s) or rename a file
mv file_name1 file_name2     # rename file_name1 to file_name2
mv file_name1 file_name2  target_directory # move files into target_directory

7. rm - Command is used to remove file(s)/directory.
rm filename     # delete a file.
rm -rf directory   # delete a directory

8. mkdir - Make a directory
mkdir directory_name     # create a directory 

9. tar - Command used to create, extract tar files
tar -xzf tar_file     # untar a tar file 
tar -czf target_folder tar_file_name    # create tar file 

10. unzip - Command to unzip a zip files
unzip zip_name    # unzip a zip file 

In this tutorial, I have mentioned 10 useful shell commands only. If you interest to know all the shell command, go to this link. Several hundreds of Shell Commands are there....

See you In Next Tutorial !

0 comments:

Post a Comment

Ask anything about this Tutorial.