Announcement

Collapse
No announcement yet.

Basic Linux Commands

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Basic Linux Commands

    Basic Linux Commands
    It is very important to learn about Linux command line interface because this is the heart of Linux. We recommend you to go through this section while sitting in front of the computer

    In this tutorial we will learn basic Linux commands with brief description.



    __________________________________________________ ___________________

    cd (change directories)

    We can use cd command for changing directories Suppose you are in the ‘asia’Directory and now you want to go its subdirectory named ‘pakistan’, you type‘cd pakistan’



    Note: -This is the same command as we use in DOS (Windows CMD).

    __________________________________________________ ___________________

    ls (use to view list files and directories)

    We use ls command to see a list of the files and directories located in current directory. Suppose you are in the named ‘websites’ and you type ls, a list will appear that shows the content of websites directory. see the screenshot below.



    Note: – You may have used the ‘dir’ command on Windows.. well ls is like ‘dir’.

    __________________________________________________ ___________________

    ls –l ( shows details list)

    ls -l linux command

    __________________________________________________ ___________________

    ls –lt (shows newest or last modified file and directory first)

    __________________________________________________ ___________________

    ls –a (shows hidden files and directories.)

    if any file or directory name starts with “.” its represents hidden contents in linux operating system.



    pwd (use to find the current location or current working directory)

    After issuing pwd command you’ll see the complete path of the directory you are currently in. This command is very helpful when you forget which directory you’ve changed.

    __________________________________________________ ___________________

    cp –r (copy files and direcotories)

    cp -r /Source Of Copy /Destination Of Copied Data

    Using “*” we can copy everything under /websites/ Directory.

    __________________________________________________ ___________________

    mv (rename files and folders)

    __________________________________________________ ___________________

    rm -r (delete files and folders)

    __________________________________________________ ___________________

    cat (read text files)

    Using cat command we can read text file contents without opening it.

    __________________________________________________ ___________________

    grep ( grep searches inside files and then print out them on shell window)

    Suppose i have huge name list save in this “NameList.txt” file. I want to search name “Haider” from this list then i use grep command to search specific word from this whole file Like This…

    Command = grep haider NameList.txt
Working...
X