what is a shell?

it is a command line interface for running programs on your computer, developers use it a lot because it is fast and flexible & the most majority of web servers in the wild run on Linux and shell is a vital tool for deployment & remote administration on Linux servers, it so much like programming
also, to interact with the shell we need a terminal and it is not just a commands it is also a programming language.

windows do have a build in command shell it is based on old MS-DOS command line rather than the UNIX.

for web developers, a Unix style shell is pretty much a professional standard because so much of the web runs on Linux servers.

in the following blog, I will use a BASH shell which is by far the most likely to Unix style shell.

windows come with a shell exactly like Linux & MAC you can call it by type in the search bar "windows Power shell" this will help you use the shell without any programs also in the next following lines I will set up a GIT bash shell to work with but it is exactly is the same.

after opening windows power shell you need to test some command lines that will help you soon :)
* ls -> LIST command this lists the files in the directory and may take some parameters such
   -l --long details  also may take  the file name it is going to list it's content
   examples:
   ls -l Documents/Books/*.pdf -- this line lists only files with .pdf extension

*cd -> current directory this enables you to open the directory and move between directories
          example:
          cd Document/books --move the current directory to books
          cd .. -- return from the current directory
*mkdir ->make directory this will create a new folder by your specified name in the directory you enter
          example:
            mkdir Document/Test -create a new folder
*mv -> move the files from a folder to another (CUT)
             example:
                            mv Documents/books/*  Documents --this will move all books contents into                                          documents
                                                        mv Documents/books Documents -- this will move books which  in documents                                    into documents so actually, this will do nothing :)
                     
                            cd Documents;mv books/*.jpg . --this will move all .jpg files to a current directory                                also we can use; to separate between commands in the same line

                            cd Documents/books; mv * .. -- move all files in that directory into the parent                                        directory which is documents
                     
                            mv 'Documents/books/*' Documents -- here we use ' ' to indicate that * is not a                                      special character  to
*CURL ->CURL or see URL it shows the source code of the page it may take some parameters                            such
                  -L to show the source code of the web page
                  -o download page from the url
                  'address' the URL
                       example:
                          curl -o google.html 'http://google.com' -- this will save the url as HTML file on your                            current directory
*CAT   ->catenate or concatenate or show the text file content all at once
*LESS -> show less of the file and you can show more by space
*rm      ->remove file
                examples:
                   rm 'rm bad File' 'good name bad face'
                   rm *bad*           --will remove all files by name
                   rm bad!good     --will remove files contain bad & good name in it
                   rm *'bad F'*      --will remove file contain "bad F" in it's name

*rmdir  -> remove directory
*grep shell dictionary.txt  -> it will list all files that contain shell in this test file
                   there is a whole language that can be used with grep you can google it:).
*Environment variables: it is related to that variables that changes while I am running the shell and can be changed when I am going threw shell commands such PWD command or in this case a variable :].

*Shell variables it is the variables that are connected to the shell itself such as PATH , LINES,COLUMNS extra.

*there is a file called ".bash_profile" which is for logging shell commands
 and ".bashrc" for non logging shell command these tow files contain the commands that will run immediately while the shell is running so these two files must be contained in the working directory with no extension if you want to edit you can run with any text editor and type any command or alias you will use
NOTICE that for git-bash shell you have to create these to files in the default working path which by default for windows 10 will be "C:\Users\HP\AppData\Roaming\SPB_Data"
and you have to Write this code to .bash_profile






to make sure that the file ".bashrc" will run but actually for windows this file is't used :) so you don't need this code but for Linux or MAC users you have to write this code

*alias this command enables you to write your hot commands in a handy way
         example alias ll='ls -la' with no spaces around equal sign


now i think that's all that you would need to deal with Git right now.




Comments