Common usage tools in linux
The main goal of this note is to record the common usage of the tools. However, some tools might not be that frequently use but when you need that, it is a kind of fast searching in this note. I will try to record as complete as possible for.
Software
Lightweight markup language - Markdown
This is one of the famous language that can be used to write the documents with only few kinds of easy notation. The application of this language like the readme file on Github, or Blog articles.
There are several tools that can edit with the markdown language. In gnome environment, the default text editor, gedit, is good enough to write the text. However, Typora is another options that it immediately shows the render results without open a new window. On the other hand, the famous editor, Atom, is also a good platform to write the markdown file.
Mark text This is better than the Typora. The interface is mixed with the Typora that you can directly view the result immediately and also show the observation
Commandline program
tree
This is for printing the documents structure, which can be used for the reconstrction data in a better arrangments.
Common usage commands
tree -dvon outputfile.txt
The meaning of parameter:
d List directories only
v Sort files alphanumerically by version.
o Output to file instead of stdout.
n Turn colorization off always
mkvmerge
Basically just for merging the files. It can additionally add the subtitle to the video.
ffmpeg
For converting, merging, and compressing the video directly. With the help from the bash script, the converting of the files could be automatically completed. [^1]
Some frequently used parameters:
Example bash script:
-
Auto execration script
1
2
3
4
5
6#!bin/bash
#-c:v libx264 -b:v 1500k video x.264, 1500k bitrate
#2 pass encode
for name in *.MTS; do
ffmpeg -y -i "$name" -c:v libx264 -deinterlace -crf 27 -preset slower -q:a 2 -af "volume=5dB" "${name%.*}.mp4"
done
#https://unix.stackexchange.com/questions/183308/help-with-script-over-a-list-of-files
LIST=''
for i in *.mp4; do
if [ -n "$LIST" ]; then LIST="$LIST +"; fi
LIST="$LIST$i"
done
mkvmerge -o newfile.mp4 $LIST
1 | - Two pass filtered Example |
Storage operation
Format the USB driver [^2]
-
Find the location of the target disk
$ lsblk
-
umount it (If located as sdd1)
$ umount /dev/sdd1
Restore liveUSB as USB disk
-
Find the location of the disk
-
sudo mkfs.vfat /dev/sdc1
-
Delete all the partition and recreate it
1 | $ sudo fdisk /dev/sdx |
[^1]: FFmpeg introduction (Chinese). FFmpeg official Website For the normalization sound of the files.