Ubuntu Tutorial

Command : command is instruction or set of instructions given by user to perform specific task or operation in the system. it gives desired output to user. example: when we run or execute ls command on terminal it perform task of displaying list of all files available in directory or folder and we get output on terminal.

syntax :    command    [opt1] [ opt2 ]....[optn]    [arg1] [arg2] ... [argn]

options : an option modifies the effect of a command. it is optional to use. you can pass multiple options to the command. usually single hyphen( - ) is used when multiple options are passed to the command. options are command specific.
1) One option: -a
2) Many options: -abc

arguments : arguments are inputs gives to command for processing. it can be string, number, path, file, directory/folder etc.

in following example we print files present in given directory or folder. ls is command name. -1 is option which is used to print file name per line. myfolder is argument (directory/folder name ).

ubuntu command option and argument

mostly command name appear first then options are passed to command and at the end argument are passed to the command. but not all the time same syntax is used. In following example both command gives same output but in cat abc.txt , cat command ( print given file on terminal ) appear first then abc.txt ( filename ) argument is passed to the command and in <abc.txt cat , <abc.txt argument appear first and then cat command is given.

ubuntu command name position