concat command 'output'

Concentric

Expert Member
Joined
Feb 16, 2017
Messages
1,028
Reaction score
197
Im still a linux noob.
I have a command with a bunch of flags that outputs to the screen with info as it runs.
Id like to append that text to a log file.
Code:
rclone move ~/docs/legal GDrive:Sort/legal --delete-empty-src-dirs>>/home/hd14/davidc75/apps/log.txt

Does this look correct?
Thanks
 
That will redirect standard out, yes.

If you also want stderr to go to the file, add 2>&1 to the end (with a space after .txt)
 
that would be error messages im assuming?

Depends how the app is written to be honest.
There are two output streams from a unix process - stdout and stderr.

Generally yes, errors to stderr
 
ok thanks. Just 'discoverd' linux. Its so powerful. cant believe its not widely used.
 
Oh, another tip for you, since you're new...

> will recreate the file
>> will append to the file.
 
i know it used for servers and backend use. im talking your aveage user
 
Can also pipe to the "tee" command that output while logging to file. Example: <command> | tee out.log
 
Top
Sign up to the MyBroadband newsletter
X