[LINUX] Create a command to get the work log

As with work, it's important to leave a work trail. Even in my personal environment, I wanted to keep a work log so that I could find the jammed place later. Due to my personality, the method of deciding the name of each log is troublesome and does not last long. I made a script so that I can get the work log by typing a fixed command.

Create a command to get the work log with alias

The command is described in **. Bashrc **. This time I entered it with ** vi **. The command to get the work log is ** outputlog **. The name of the log is in the form "year / month / day_hour / minute / second.log".

Open ./bashrc

$ vi ~/.bashrc

Add alias to the bottom and save

alias outputlog='script /home/pi/Desktop/scriptlogs/$(date +%Y%m%d_%H%M%S).log'

That's all. You can get the log by executing ** outputlog ** where you want to get the log.

Task

There is no problem on the terminal, but when I output it to the log, the characters are garbled. I tried some, but it didn't work. I would like to know if there is a good way to solve it.

Recommended Posts

Create a command to get the work log
[Go] Create a CLI command to change the extension of the image
Create a function to get the contents of the database in Go
[Linux] Command to get a list of commands executed in the past
Use click to create a sub-sub command --netsted sub-sub command -
Try to create a new command on linux
Use pygogo to get the log in json.
Zip-compress any file with the [shell] command to create a file and delete the original file.
Create a filter to get an Access Token in the Graph API (Flask)
Read the Python-Markdown source: How to create a parser
How to create an article from the command line
How to write a GUI using the maya command
How to create a submenu with the [Blender] plugin
The shortest route to get a cultural fish environment
I made a command to markdown the table clipboard
Get UNIXTIME at the beginning of today with a command
[Command] Command to get a list of files containing double-byte characters
Probably the easiest way to create a pdf with Python3
How to get the last (last) value in a list in Python
I want to create a Dockerfile for the time being.
I tried to create a Python script to get the value of a cell in Microsoft Excel
Command to create Linux Live USB
Steps to create a Django project
How to create a Conda package
In the python command python points to python3.8
How to get the Python version
[linux] kill command to kill the process
How to create a Dockerfile (basic)
5 Ways to Create a Python Chatbot
What to do to get tensorflow-gpu to work
How to create a config file
[AWS] What to do when the ping command causes a "timeout"
[C language] [Linux] Try to create a simple Linux command * Just add! !!
[sh] How to store the command execution result in a variable
How to get all the possible values in a regular expression
Create a shell script to run the python file multiple times
How to make a command to read the configuration file with pyramid
How to get a string from a command line argument in python
I want to create a system to prevent forgetting to tighten the key 1
How to output the output result of the Linux man command to a file
How to get the vertex coordinates of a feature in ArcPy
A command to easily check the speed of the network on the console
I made a command to display a colorful calendar in the terminal
Create a REST API to operate dynamodb with the Django REST Framework
Create a command line tool to convert dollars to yen using Python
I want to get information from fstab at the ssh connection destination and execute a command
A story that didn't work when I tried to log in with the Python requests module
I tried to create a linebot (implementation)
How to create a clone from Github
Create a bot to retweet coronavirus information
How to create a git clone folder
I tried to create a linebot (preparation)
Give a title to the ipywidgets tab
Various methods to numerically create the inverse function of a certain function Introduction
Create a graph using the Sympy module
[Linux] How to use the echo command
How to use the Linux grep command
Create a command to delete all temporary files generated in a specific folder
Get the path to the systemd unit file
How to get a stacktrace in python
To get a local IP address programmatically