Monday, August 17, 2015

Operating System Command


1. ls COMMAND:
     ls command lists the files and directories under current working directory.

       SYNTAX:
       The Syntax is
       ls [OPTIONS]... [FILE]



2. Word Count (WC) COMMAND:
     Word Count (Wc) command counts and displays the number of lines, words,   character and number of bytes enclosed in a file.

     SYNTAX:
     The Syntax is
     wc [filename]



3. rmdir COMMAND:
     rmdir command is used to delete/remove a directory and its subdirectories.

      SYNTAX:
      The Syntax is
      rmdir [options..] Directory



4. mkdir COMMAND:
     mkdir command is used to create one or more directories.

     SYNTAX:
     The Syntax is
     mkdir [options] directories



5. cat COMMAND:
     cat command concatenates files and print it on the standard output.

     SYNTAX:
     The Syntax is
     cat [OPTIONS] [FILE]...


6. cp COMMAND:
     cp command copy files from one location to another. If the destination is an existing file, then the file is overwritten; if the destination is an existing directory, the file is copied into the directory (the directory is not overwritten).

      SYNTAX:
      The Syntax is
      cp [OPTIONS]... SOURCE DEST
      cp [OPTIONS]... SOURCE... DIRECTORY
      cp [OPTIONS]... --target-directory=DIRECTORY SOURCE...



7. cd COMMAND:
     cd command is used to change the directory.

     SYNTAX:
     The Syntax is
     cd [directory | ~ | ./ | ../ | - ]



8. ps  COMMAND:
     lists all current runnig processes , their corresponding pids , and their status

      SYNTAX:
      The Syntax is
       ps  -a
       ps  -r
      ps  -s



9. more COMMAND:
     more command is used to display text in the terminal screen. It allows only backward movement.

      SYNTAX:
      The Syntax is
      more [options] filename



10. less COMMAND:
     less command is used to display text in the terminal screen. It just prints the text in the given file, you cannot edit or manipulate the text here. To display the file from the specified line, enter the line number followed by colon(:). It allows Forward and backward movement in the file.

      SYNTAX:
      The Syntax is
       less [options] filename

11. man COMMAND:
     man command which is short for manual, provides in depth information about the requested command (or) allows users to search for commands related to a particular keyword.

      SYNTAX:
      The Syntax is
      man commandname [options]

12. mv COMMAND:
     mv command which is short for move. It is used to move/rename file from one directory to another. mv command is different from cp command as it completely removes the file from the source and moves to the directory specified, where cp command just copies the content from one file to another.

     SYNTAX:
     The Syntax is
     mv [-f] [-i] oldname newname



13. passwd COMMAND:
     passwd command is used to change your password.

     SYNTAX:
     The Syntax is
     passwd [options]



14. pwd COMMAND:
     pwd - Print Working Directory. pwd command prints the full filename of the current working directory.

     SYNTAX:
     The Syntax is
     pwd [options]



15. chmod COMMAND:
     chmod command allows you to alter / Change access rights to files and directories.

      SYNTAX:
      The Syntax is
      chmod [options] [MODE] FileName



16. free COMMAND:
     display information about the free and used memory on the system .

      SYNTAX:
      The Syntax is
      free [options]



17. who COMMAND:
      who command can list the names of users currently logged in, their terminal, the time they have been logged in, and the name of the host from which they have logged in.

      SYNTAX:
      The Syntax is
      who [options] [file]



18. cal COMMAND:
     cal command is used to display the calendar.

      SYNTAX:
      The Syntax is
      cal [options] [month] [year]



19. clear COMMAND:
     This command clears the terminal screen.

       SYNTAX:
       The Syntax is
        clear



20. chown COMMAND:
     chown command is used to change the owner / user of the file or directory.       This is an admin command, root user only can change the owner of a file or directory.

      SYNTAX:
      The Syntax is
      chown [options] newowner filename/directoryname


21. hostname COMMAND:
     get or set hostname . Typically , the host name is stored in the file /etc/HOSTNAME.

      SYNTAX:
      The Syntax is
      hostname



22. uname COMMAND:
     print the information about the current system.

     SYNTAX:
     The Syntax is
     uname



23. gzip COMMAND:
     gzip is a command used to compress or decompress the files or a folder with the extension .gz.

     SYNTAX:
     The Syntax is
     gzip [options] filename


24. cmp COMMAND:
     compare two files of any type.

      SYNTAX:
      The Syntax is
      cmp file 1 file 2



25. kill COMMAND:
     kill command is used to kill the background process.

       SYNTAX:
       The Syntax is
        kill [-s] [-l] %pid



26. nohup COMMAND:
     Linux has the ability to run a job in background using commands such as &, bg. The job would be killed when the root user logs out. In order to avoid this, nohup command is used.

      SYNTAX:
      The Syntax is
      nohup Command & option







27. tty COMMAND:
     print the file name of the terminal connected to the standard input.

      SYNTAX:
      The Syntax is
      tty[option]..


28. tee COMMAND:
     tee command executes the given command and stores the standard output of that command in to one or more files.

       SYNTAX:
       The Syntax is
        tee [OPTION]... [FILE]..



29. df  COMMAND:
     Display the total size, used and available space on all mounted file system.

        SYNTAX:
       The Syntax is
        df



30. du  COMMAND:
     provide a summary of the disk spaced used by a particular file.

        SYNTAX:
        The Syntax is
         du


31. date COMMAND:
     date command is used to get month date and time.

        SYNTAX:
        The Syntax is
        date



32. echo COMMAND:
     echo command prints the given input string to standard output.

       SYNTAX:
       The Syntax is
       echo [options..] [string]



33. sleep COMMAND:
     sleep command is used to delay for a specified amount of time .

        SYNTAX:
        The Syntax is
         sleep option

No comments: