Linux

Search Files

If you are searching for a file with the name my-file, you can do:

find -name "my-file*"

Search Words within files

If you want to find files that contain specific words e.g. my_word, you can do:

grep -iRl "my_word"
# grep --help
# -i --ignore-case
# -R --dereference-recursive
# -l --files-with-matches

Quick Reference

**tar**命令

# 压缩
tar -cfv out.tar source.file
# 解压
tar xfv out.tar
tar xfvz out.tgz --directory unzip_dir
  • 断开ssh
    • logout or CTRL+D
  • 拷贝到远程
    • scp -r /home/Downloads/source_file root@www.runoob.com:/home/root/others/

Working with files

Using placeholders (can be used with cmd such as ls, rm, mv etc)
PlaceholderMeaning
*Any set of characters
?Any single character
[a-f]Characters in [abcdef]
[^a-c]Any character not in [abc]

Example:

1 $ ls
2 u01.tex v01.pdf v01.tex
3 u02.tex v02.pdf v02.tex
4 u03.tex v03.pdf v03.tex
5
6 $ ls *. pdf
7 v01.pdf v02.pdf v03.pdf
8
9 $ ls u*
10 u01.tex u02.tex u03.tex
11
12 [/home/student/Examples/placeholders]$ ls ?01*
13 u01.tex v01.pdf v01.tex
14
15 [/home/student/Examples/placeholders]$ ls [uv]01*
16 u01.tex v01.pdf v01.tex
17
18 [/home/student/Examples/placeholders]$ ls u0[^12].tex
19 u03.tex
Searching
$ find <in-folder> -name <filename>
    Search for file <filename> in folder <in-folder>, allows wildcards

$ locate <filename>
    Search for file <filename> in the entire system! (just remember to <sudo updatedb> often)

$ grep <what> <where>
    Search for a string <what> in a file <where>
Chaining commands
$ command1; command2; command3
    Calls commands one after another

$ command1 && command2 && command3
    Same as above but fails if any of the commands returns an error code

$ command1 | command2 | command3
    Pipe stdout of command1 to stdin of command2
 and stdout of command2 to stdin of command3
    Piping commonly used with grep:
    
$ ls | grep smth
    look for smth in output of ls

Embedded Linux

embedded linux

Touch Screen Setup

Calibrating a touch-screen on dual monitors

In terminal, type:

xinput --map-to-output $(xinput list --id-only "Wacom TouchScreen Finger touch") USB-C-0

For HUION Drawing Tablet

xinput --map-to-output $(xinput list --id-only "HUION Huion Tablet Pen Pen (0)") DP-4