-1

Is there a way to do these two lines of code in one line?

nc -l 17500 > listenToNetcat.txt
chmod 754 listenToNetcat.txt
Anthon
  • 78,313
  • 42
  • 165
  • 222
  • 1
    Why don't you set your `umask` beforehand so the file will get the appropriate permissions? – Anthon Feb 15 '15 at 19:01
  • Sorry for being such a noob in this. How would it look like if it would be done like you said? I just started to learn these command lines and it is very difficult, I was glad I found the two lines of code. – user3004449 Feb 15 '15 at 19:09

1 Answers1

0
nc -l 17500 >> listenToNetcat.txt |xargs chmod 754 listenToNetcat.txt
klerk
  • 2,779
  • 2
  • 16
  • 15