Skip to content

Commit

Permalink
how to set linux time & how to save the output of the command to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Peeeeanut committed Jun 27, 2024
1 parent c4b055f commit a41c3be
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
12 changes: 12 additions & 0 deletions 24-06/linux_time.md
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)
14 changes: 14 additions & 0 deletions 24-06/save_output_to_file.md
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)
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

[01 Python-venv](24-06/python-venv.md)

[02 What is nohup](24-06/what_is_nohup)
[02 What is nohup](24-06/what_is_nohup.md)

[03 How to set linux system time](24-06/linux_time.md)

[04 How to save the output to a file](24-06/save_output_to_file.md)

0 comments on commit a41c3be

Please sign in to comment.