-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
how to set linux time & how to save the output of the command to a file
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Set the linux system time to the local time in China | ||
|
||
``` | ||
sudo timedatectl set-timezone Asia/Shanghai | ||
``` | ||
|
||
``` | ||
[root@jiakai-openeuler-01 ~]# date | ||
Thu Jun 27 06:37:30 PM CST 2024 | ||
``` | ||
|
||
[back](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Save the output of the command to a file | ||
|
||
When running models in tensorflow, it is necessary to save training/inference results. It is more convenient to save the output results to a file, and then customize the name of the file, so that it is particularly convenient in the later viewing process. | ||
|
||
**How to use:** | ||
|
||
``` | ||
command > output_name.txt 2>&1 | ||
``` | ||
|
||
* `>` is the redirect operator, which redirects the standard output (stdout) of the command to the specified file. If the file already exists, this overwrites the original content; If the file does not exist, it will create a new file. | ||
* `2>&1` is very important because it means to redirect the standard error (stderr, number 2) to the same place as the standard output (stdout, number 1). In other words, this saves all output of the command, whether normal output or error messages, to the output_name.txt file. | ||
|
||
[back](../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters