Linux command, C++

1. argc, argv (C++)

Reference: argc-argv.html

2. cp (copy file or folder to another directory) (Linux)

Reference: cp-command

3. vector (C++)

Reference: Vector

4. assert (C++)

ex: assert(iTotalNumber < 1000);
Means若 iTotalNumber < 1000 則程式可以繼續執行;若iTotalNumber >= 1000 ,則會秀出維護錯誤訊息的字串,並結束程式。

5. chmod (Linux)

Revise file property. (chmod 777 file)

Reference: chmodchmod2

6. rm (Linux)

For deleting files, folders...

Reference: rm

7. readlink

Find file's path

ex: readlink -f file.txt

8. clone

Copy a data without possibility of interfacing to original parameter.

Reference: clone()

9. Iterator

Reference: iterator

10. reserve

Reference: reserve

11. erase

Reference: erase

12. Gaussian distribution noise

Reference: Gaussian noise

13. const

可用於修飾函數傳遞參數,在函數內不可被改變。
Reference: const

14. Meaning of "make -jn"

Denotes how many threads you want to allot for compiling. (Whether it's safe to use n = number of cores also depends on whether you have enough memory for all the parallel compile/link jobs.)

Reference: what-does-make-jn-mean

15. 無線網路設定

(1)自動連接

Edit /etc/network/interfaces and write:
auto wlan0
iface wlan0 inet dhcp 
                wpa-ssid {ssid}
                wpa-psk  {password}
After that write and close file and use command:
sudo dhclient wlan0
(2)切換不同訊號源

nmcli dev wifi connect <mySSID> password <myPassword>

Reference: Connecting to wifi network through command line

16. 編輯文字檔

vim <filename>

Turn to edit mode by keying in  i/o/a ("insert" will show out)

"Esc" for leaving edit mode

":wq" for save & leave (or ":wq!")

Reference: vim 程式編輯器

17. Remove

Reference: http://blog.lyhdev.com/2013/01/ubuntu-linux-apt-get.html

18. Check space

Reference: https://blog.csdn.net/jiedao_liyk/article/details/78497625

19. Check & set baudrate of tty device

Check: stty -F /dev/ttyUSB0
Set: stty -F /dev/ttyUSB0 921600

Reference: http://a-chien.blogspot.com/2013/02/rs232.html

20. Convert image to video

Command example: 
ffmpeg -r 500 -f image2 -s 648X488 -start_number 1 -i img%5d.pgm -vcodec libx264 -crf 15 -pix_fmt yuv420p L.avi

21. Multithread

Reference:
[1] https://blog.gtwang.org/programming/pthread-multithreading-programming-in-c-tutorial/
[2] Linux系統下的多線程編程入門



留言

這個網誌中的熱門文章

Tuing PID parameters in QGroundcontrol (2)

Useful PX4 Parameters

Burn linux image to eMMC storage on Banana Pi M3