blob: a4384a09455f4fd1a6825d0a5d389dc209393c95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Oneliners
A Growing Collection of Linux Command Line One-Liners
Please believe me... this collection was really supposed to grow over time...
inside a direcotry show disk usage of all hidden files and directories and sort by size:
$ du $(ls .* -d | tail -n +3) -hs |sort -h
inside a direcotry show disk usage of all files and directories (also hidden) and sort by size.
Exclude 'garbage' file.
$ du . -a -d 1 -h --exclude=garbage | sort -h
Tar all files in current directory, excluding ./DATA and ./.cache
$ tar --exclude=.cache -cvf home_miguel_20180216.tar .
Find files in ./ARCHIVE NOT belonging to a specific user: miguel
$ find ARCHIVE/ \! -user miguel
set folder/ permissions to Read/Browse only for owner recursively
$ sudo chmod -R u=r,g=,o= folder/
$ chmod -R u=rX,g=,o= folder/
find all mails from Boban when in the maildir full of mailboxes and print only short headers without bodies:
$ grepmail -H -B -Y ‘(^TO:|^From:)’ Boban *
not really a one-lier but will print 256 colors in a bash:
for i in {0..255} ; do
printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i"
if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then
printf "\n";
fi
done
## Web Video and Audio
convert a video to the **WebM** container format, accommodating the **VP8** video codec
and the **MP4** container accommodating the **H.264** codec.
Providing this two versions of your video should result in a decent coverage according to:
<https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility>
ffmpeg -i video.mp4 -vcodec vp8 mazeball.webm
ffmpeg -i video.mp4 -vcodec h264 mazeball.mp4
If you require an audio codec as well use **Vorbis** in **WebM** and
**AAC** inside **MP4** respectively.
Yet before making a final decision, consider that many modern devices
have hardware to assist in video and audio decoding, saving on CPU and
battery consumption.
|