[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum moderator: shanky, Piyu, Resh  
what is > , >>, <, << commands in linux?
PiyuDate: Friday, 2014-04-04, 4:23 PM | Message # 1
Private
Group: Users
Messages: 10
Awards: 0
Reputation: 21
Status: Offline
what is > , >>, <, << commands in linux?. Can you explain plz shankar..I need to know as i support kwom.
 
shankyDate: Friday, 2014-04-04, 6:40 PM | Message # 2
Lieutenant
Group: Administrators
Messages: 46
Awards: 0
Reputation: 104
Status: Offline
Dear Piyu...
Sure I will answer this smile

Actullay these are not commands. They are redirection operators in Linux which are used tosend or receive data to/ from following posible places:

  • To a file

  • To standard output(/dev/stdout), generally the system console

  • To standard input (/dev/stdin), generally the keyboard input

  • To standard error output (/dev/stderr).


For example,

user1@server1:/home/user1:> cat >> abc.txt
addinf extra
lines
to existing
file

The above command actually reads data from keyboard and redirects it to the file abc.txt

user1@host:/home/user1:> cat < abc.txt
shdf\
skjdfhksd
dsh
addinf extra
lines
to existing
file

The above command reads the data from abc.txt and redirects it to the system console.

Example 2:While redirecting output to a file '>' can be used to insert fresh data to file and '>>' can be used to appned data to existing file.

Prompt:> cat > abc.txt
this is
fresh
data

Prompt:> cat >> abc.txt
and
this
appended
data

Prompt:> cat abc.txt
this is
fresh
data
and
this
appended
data

Example 3: If you want to redirect output of a command to a file, you can use '>' operator.
Prompt:>ls
abc.ps  abc.txt  abc.txt-20140325  bin  dfg  Documents  public_html  qquniq.profile  shanky.sh  somon_output  tmp

Prompt:> ls>abc.txt

Prompt:> cat abc.txt
abc.ps
abc.txt
abc.txt-20140325
bin
dfg
Documents
public_html
shanky.sh
tmp

I hope this will be helpful. Need further info, please reply.
Dont forget to like.


s.k.bhagat
 
shankyDate: Friday, 2014-04-04, 6:55 PM | Message # 3
Lieutenant
Group: Administrators
Messages: 46
Awards: 0
Reputation: 104
Status: Offline
Completely my pleasure

s.k.bhagat
 
PiyuDate: Friday, 2014-04-04, 7:10 PM | Message # 4
Private
Group: Users
Messages: 10
Awards: 0
Reputation: 21
Status: Offline
Can you tell me shankar how should i change password in shankysportal?
 
  • Page 1 of 1
  • 1
Search: