Try
{ time sleep 1 ; } 2> time.txt
which combines the STDERR of “time” and your command into time.txt
Or use
{ time sleep 1 2> sleep.stderr ; } 2> time.txt
which puts STDERR from “sleep” into the file “sleep.stderr” and only STDERR from “time” goes into “time.txt”
More Related Contents:
- Command to get time in milliseconds
- create a file with prefix =file1 followed by the random number
- Why to code a script which will check if some package is installed in linux and if not then install it?
- How to permanently set $PATH on Linux/Unix [closed]
- How do I use sudo to redirect output to a location I don’t have permission to write to? [closed]
- Read values into a shell variable from a pipe
- Bash ignoring error for a particular command
- Fastest way to find lines of a file from another larger file in Bash
- How to replace spaces in file names using a bash script
- Use sudo with password as parameter [closed]
- Shell script: Run function from script over ssh
- How can I quickly sum all numbers in a file?
- Bash script process substitution Syntax error: “(” unexpected
- Given two directory trees, how can I find out which files differ by content? [closed]
- bash alias command with both single and double quotes
- Recursively look for files with a specific extension
- Take nth column in a text file
- Add a bash script to path
- Run multiple commands at once in the same terminal
- how to get MouseMove and MouseClick in bash?
- Get last dirname/filename in a file path argument in Bash
- Bash script execution with and without shebang in Linux and BSD
- Variable in Bash Script that keeps it value from the last time running
- Exit code of variable assignment to command substitution in Bash
- How do I get cURL to not show the progress bar?
- Using `date` command to get previous, current and next month
- Linux: remove file extensions for multiple files
- Joining multiple fields in text files on Unix
- How to perform a for-each loop over all the files under a specified path?
- How to create a dynamic variable and assign value to it?