yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
ROSMASTER R2📖
1.Preparation and First Trial
  • 1.1 Accessories introduction
  • 1.2 Precautions for battery
  • 1.3 First Trial
2.Assembly steps
  • Installaction Video
3.ROS1-Remote control course
  • 3.1 APP remote control
  • 3.2 Model aircraft remote control
  • 3.3 Handle remote control
4.ROS1-Hardware course
  • 4.1 About expansion board_V3.0
  • 4.1 About expansion board_V1.0
  • 4.2 STM32 Development environment
  • 4.3 Button to control the buzzer to whistle
  • 4.4 FreeRTOS application
  • 4.5 Serial communication
  • 4.6 SBUS model aircraft remote control
  • 4.7 CAN bus communication
  • 4.8 RGB colorful light bar
  • 4.9 Timer interrupt to control PWM servo
  • 4.10 Control serial port servos
  • 4.11 Nine-axis attitude sensor to obtain data
  • 4.12 Control motor
  • 4.13 Timer captures the encoder data
  • 4.14.1 Kinematic Analysis of Mecanum Wheel
  • 4.14.2 Kinematics Analysis of Ackermann Car
  • 4.15 PID control robot movement
5.ROS1-Basic course
  • 5.1 Update the firmware
  • 5.2 Turn off the self-starting process at startup
  • 5.3 Install the Rosmaster driver library
  • 5.4 Buzzer whistle
  • 5.5 Control PWM servo
  • 5.6 RGB colorful light bar special effects display
  • 5.7 Control motor
  • 5.8 Control robot movement
  • 5.9 Control Serial Servo
6.ROS1-Linux operating system
  • 6.1 Virtual machine installation and use
  • 6.2 Linux basics
  • 6.3 Remote control
  • 6.4 Multi-machine communication configuration
  • 6.5 Static IP and hotspot mode
  • 6.6 Bind the device ID
  • 6.7 Web page real-time monitoring
  • 6.8 Expansion tutorial
  • 6.9.1 Jetson Nano write sytem
  • 6.9.2 Jetson Xavier NX write system
  • 6.9.3 Jetson TX2 NX write system
  • 6.9.4 Raspberry Pi write system
7.ROS1-Docker-pi5
  • 1、Docker overview and docker installation
  • 2、Common commands for docker image containers
  • 3、Docker images deeply understand and publish images
  • 4、Docker hardware interaction and data processing
  • 5、Enter the bot's docker container
  • 6、Robot development environment construction in Docker
  • 7、How customers can update docker images in the future
8.ROS1-ROS basic course
  • 1.ROS introduction
  • 2.ROS installation
  • 3.ROS common command tools
  • 4.ROS workspace
  • 5.ROS function package
  • 6.ROS node
  • 7.ROS topic publisher
  • 8.ROS topic subscribers
  • 9.ROS service client
  • 10.ROS service server
  • 11.ROS action client
  • 12.ROS action server
  • 13.ROS custom message reception
  • 14.ROS-launch file
  • 15.ROS-TF transformation
  • 16.ROS parameter service
  • 17.ROS-rviz use
  • 18.ROS-rqt tool usage
  • 19.Topic message recording and playback
  • 20.urdf model introduction
  • 21.gazebo introduction
  • 22.ROS distributed communication
9.ROS1-OpenCV courses
  • 9.1 Getting started with Open Source CV
  • 9.2 Geometric transformation
  • 9.3 Image processing and drawing text line segments
  • 9.4 Image beautification
  • 9.5 Opencv application
  • 9.6 AR vision
  • 9.7 AR QR code
  • 9.8 ROS+Opencv foundation
  • 9.9 ROS+Opencv application
  • 9.10 Data transformation and point cloud
  • 9.11 MediaPipe development
10.ROS1-Robot control course
  • 10.1 PID algorithm theory
  • 10.2 Robot PID debugging
  • 10.3 Robot information release
  • 10.4 Robot keyboard control
  • 10.5 Robot handle control
  • 10.6 Robot state estimation
  • 10.7 Robot calibration
  • 10.8 Robot URDF model
11.ROS1-Depth camera course
  • 11.1 How to use the Astra camera
  • 11.2 Astra camera calibration
  • 11.3 Astra Color Tracking
  • 11.4 Astra Object Tracking
  • 11.5 Visual tracking autopilot
  • 11.6 Pure visual 2D mapping and navigation
  • 11.7 RTAB-Map 3D mapping navigation
  • 11.8 ORB_SLAM2 basics
  • 11.9 ORB_SLAM2_Octomap
12.ROS1-Lidar course
  • 11.1 Lidar basic-SLAM
  • 11.1 Lidar basic-EAI
  • 11.2 Lidar avoiding
  • 11.3 Lidar guard
  • 11.4 Lidar follow
  • 11.5 Patrol game
  • 11.6 gmapping mapping
  • 11.7 hector mapping
  • 11.8 karto mapping
  • 11.9 cartographer mapping
  • 11.10 rrt_exploration mappin
  • 11.11 AMCL
  • 11.12 Navigation and avoiding
  • 11.13 APP mapping and navigation
  • 11.14 TEB path planning algorithm
13.ROS1-Multi-robot control course
  • 13.1 Multi-machine handle control
  • 13.2 Multi-machine navigation
  • 13.3 Multi-machine formation
  • 13.4 Multi-machine surround
14.ROS1-Deep learning courses
  • 14.1 KNN recognizes handwritten digits
  • 14.2 Basic use of TensorFlow
  • 14.3 Basic use of PyTorch(jetson)
  • 14.4 yolov5 model training(jetson)
  • 14.5 yolov5+tensorrt acceleration(jetson)
  • 14.6 yolov4-tiny
15.ROS1-Voice control courses
  • 15.0 How to use old voice module in new image
  • 15.1 Introduction of voice control module-NEW
  • 15.2 Voice control module port binding-NEW
  • 15.1 Introduction of voice control module-Old
  • 15.2 Voice control module port binding-Old
  • 15.3 Voice control car movement
  • 15.4 Voice control Autopilot
  • 14.5 Voice control color recognition
  • 15.6 Voice control color tracking
  • 15.7 Voice control multi-point navigation
16.ROS1-Model training Autopilot
  • 16.0 ReadMe
  • 16.1 yolov5 to train traffic signs
  • 16.2 TensorRt acceleration identification mark
  • 16.3 Road sign indication function description
  • 16.4 Collect data
  • 16.5 Training model
  • 16.6 Model transformation and application
  • 16.7 AI Autopilot
17. ROS2-Remote control course
  • 1. APP remote control
  • 2. Model aircraft remote control
  • 3. Handle remote control
18.ROS2-Hardware course
  • 1. Expansion board introduction_V3.0
  • 1. Expansion board introduction_V1.0
  • 2. STM32 development environment build
  • 3. Key control buzzer sounding
  • 4. FreeRTOS applications
  • 5. Serial communication
  • 6. SBUS model airplane remote control
  • 7. CAN bus communication
  • 8. RGB colorful light bar
  • 9. Timer interrupt control PWM servos
  • 10. Control serial servos
  • 11. Nine-axis attitude sensor acquires data
  • 12. Control motor forward and reverse
  • 13. Timer Capture Encoder Data
  • 14. Theory of Robot Kinematics Analysis
  • 14.1.Mecanum wheel
  • 14.2.Ackerman
  • 14.3.4WD
  • 15. PID control of robot motion
19. ROS2-Basic course
  • 1. Update the firmware of the expansion board
  • 2.Close the large self-starting program at boot
  • 3. Install Rosmaster driver library
  • 4. Buzzer sounding
  • 5. Control PWM servo
  • 6. RGB colorful light bar special effects show
  • 7. Control motor forward and reverse
  • 8. Controlling robot motion
  • 9. Control serial servos
20. ROS2-Linux operating systemnew
  • 01. Virtual Machines
  • 02. Linux Basics
  • 03. Remote control
  • 04. Multi-computer communication configuration
  • 05. Static ip and hotspot mode
  • 06. Bind device ID
  • 07.Webpage real-time monitoring
  • 08. Expansion Tutorial
  • 09-1.Jetson Nano write system file
  • 09-2. Raspberry Pi write system file
  • 09-3.Orin write system
  • 10.Jetpack old system upgraded to SUPER systemnew
21.ROS2 -Docker(Nano Pi)
  • 1. docker overview and docker installation
  • 2. docker image container common command
  • 3. docker image in-depth understanding and publishing images
  • 4. docker hardware interaction and data processing
  • 5. Enter the docker container of the robot
  • 6. docker in the robot development environment build
  • 7. Customer's method of updating docker images in the future
22.ROS2- ROS2 Basic Tutorial
  • 1.Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 Rqt Toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
23. ROS2-Robot control course
  • 1. PID algorithm theory
  • 2. Robot information release
  • 3. Robot control
  • 4. Robot state estimation
  • 5. Robot calibration
  • 6. URDF model
24. ROS2-Lidar course
  • 1-1. Introduction and use of SLAM lidar
  • 1-2. Introduction and use of 4ROS lidar
  • 2. Lidar obstacle avoidance fun gameplay
  • 3. Lidar tracking fun gameplay
  • 4. Patrol function play
  • 5. gmapping map building algorithm
  • 6. cartographer building algorithm
  • 7. Navigation and obstacle avoidance
  • 8. Rosmaster_R2 using the app to build maps
  • 9. Rosmaster_R2 navigating with the app
25. ROS2-OpenCV courses
  • 1. opencv basic course
  • 2. ROS+opencv application
  • 3. QR code creation and recognition
  • 4. AR Vision
  • 5. mediapipe fun gameplay
  • 6. Patrol line autopilot
26. ROS2-Depth camera courses
  • 1. Depth camera use
  • 2. Camera calibration
  • 3. Color tracking
  • 4. KCF object tracking
  • 5. ORB_SLAM2 Basics
  • 6. ORB_SLAM2 PCL mapping
  • 7. ORB_SLAM2 Octomap mapping
  • 8. RTAB-Map 3D mapping navigation
27.ROS2- Voice control courses
  • 0. How to use old voice module in new image
  • 1.1 Introduction to the module-New
  • 1.2 Voice Control Module Port Binding-New
  • 1.3 Introduction to the module-Old
  • 2. Voice control car movement
  • 3. Voice control autopilot
  • 4. Voice control color recognition
  • 5. Voice control color tracking
  • 6. Voice control multi-point navigation
28.Deep learning courses(SUPER)
  • 1.KNN recognizes handwritten digitsnew
  • 2.Basic use of TensorFlownew
  • 3.Basic use of PyTorch(jetson)new
  • 4.YOLOv11Model conversion(SUPER)new
  • 5.YOLOv11Dataset annotation(SUPER)new
  • 6.YOLOv11Model conversion + tensorrt acceleration(SUPER)new
  • 7.YOLOv11Object recognition(SUPER)new
29. ROS2-Multi-robot control
  • 1. Multi-robot control
  • 2. Multi-robot navigation
LLM tutorial
1.Development environment
  • 0. Model usage instructions
  • 1.Environments deployment
  • 2.Dialogue platform installation
2.Jetson Nano B01
  • 1.Qwen2 model
  • 2.TinyLlama model
  • 3.Phi-3 model
  • 4.Gemma model
  • 5.Orca Mini model
  • 6.StarCoder2 model
  • 7.DeepSeek-R1 model
  • 8.Expand LLaVA-Phi3
3.Jetson Orin NXNANO
  • 1.Llama3 model
  • 2.Qwen2 model
  • 3.Phi-3 model
  • 4.Gemma model
  • 5.WizardLM2 model
  • 6.Codellama model
  • 7.DeepSeek-R1 model
  • 8.Orca Mini model
  • 9.StarCoder2 model
  • 10.TinyLlama model
  • 11.Expand LLaVA
  • 12.Expand LLaVA-Phi3
4.Raspberry Pi 5B
  • 1.Meta AI Llama3 model
  • 2.Qwen2 model
  • 3.Phi-3 model
  • 4.Gemma model
  • 5.WizardLM2 model
  • 6.Meta AI Codellama model
  • 7.DeepSeek-R1 model
  • 8.Expand LLaVA
FAQ
  • 1.Using your own Jetson board, car cannot start normally
Download
  • RemoteCtrl_APP(iOS/Android)
  • Mapping_APP(iOS_Android)
  • Instruction Manual
  • SystemFile_ROS1
  • SystemFile_ROS2
  • SystemFile_ROS2_OrinNANOSUPER
  • SystemFile_ROS2_OrinNXSUPER
  • VM software
  • Code
  • Jetson_Boot_USB.tar.gz
  • Autopilot Annex
  • Other_Annex_File
  • LLM_SystemFile
  • ROS2_Basic_VM
Download ZIP

Welcome to ROSMASTER R2 repository

02. Linux Basics

02. Linux Basics

2.1 Introduction to the Linux System

Linux is an open-source operating system whose kernel was first released by Linus Bennedict Tovaz on October 5, 1991. It inherits Unix's network-centered design idea and is a multi-user network operating system with stable performance.

In March 1994, Linux 1.0 was released with 170,000 lines of code, which was released under a completely free and free agreement, and then officially adopted the GPL.

In January 1995, Bob Young founded RedHat (Little Red Hat), with GNU, Linux as the core, integrating more than 400 open-source program modules, and came up with a branded Linux, i.e., RedHat Linux, which is called Linux distribution, and sold in the market.

In June 1996, the Linux 2.0 kernel was released, which can support multiple processors.

  • Main features of Linux

Free and open source; fully compatible with the POSIX 1.0 standard; multi-user, multi-tasking; has a good interface; supports multiple platforms.

  • Linux Main Versions

Currently there are about 300 Linux distributions, almost all of which can be run as server systems.Linux distributions rarely copy each other, and the popular Linux server distributions are mainly the following:

Red Hat Enterprise Linux (Red Hat Enterprise Linux): this is the first Linux distribution for the commercial market. It is available in server versions and supports numerous processor architectures.

Debian: Debian runs extremely stable, which makes it ideal for servers.

CentOS: CentOS is an enterprise Linux distribution that has been rebuilt using the free source code from Red Hat Enterprise Linux. This rebuild completely removes the registered trademarks as well as a very minor change in the Binary package.

Ubuntu: Ubuntu is a derivative of Debian, focusing on its use in this market, and is common on servers, cloud computing, and even some mobile devices running Ubuntu Linux.

2.2. Overview of Ubuntu

Ubuntu is a Linux operating system with a focus on desktop applications.Ubuntu is based on the Debian distribution and the Gnome desktop environment, and as of version 11.04, the Ubuntu distribution dropped the Gnome desktop environment in favor of Unity. As of Ubuntu 18.04 LTS, the Ubuntu distribution has reverted to using the GNOME3 desktop environment. Debian-based Ubuntu is on almost every Linux-related list, and Canonical's Ubuntu trumps every other Linux server distribution -- from easy installation and excellent hardware discovery to world-class commercial support. Ubuntu sets a rigorous standard that is hard to match.

2.3 The Ubuntu File System

Unlike Windows, Ubuntu does not have a disk drive, there is only a root directory [/], and all files are located under it.

xxxxxxxxxx
├── bin          # bin是Binary的缩写。存放系统中最常用的可执行文件(二进制)。
 # bin is an abbreviation for Binary. Holds the most commonly used executable (binary) files on the system.
├── boot         # 这里存放的是linux内核和系统启动文件,包括Grub、lilo启动器程序。
 # This is where the linux kernel and system boot files are stored, including the Grub and lilo bootloader programs.
├── dev          # dev是Device(设备)的缩写。该目录存放的是Linux的外部设备,如硬盘、分区、键盘、鼠标、usb等。
 # dev is an abbreviation for Device. This directory holds Linux external devices, such as hard disks, partitions, keyboards, mice, usb, and so on.
├── etc          # 这个目录用来存放所有的系统管理所需要的配置文件和子目录,如passwd、hostname等。
  # This directory is used to store all the configuration files and subdirectories needed for system administration, such as passwd, hostname, and so on.
├── home         # 用户的主目录,在Linux中,每个用户都有一个自己的目录,一般该目录名是以用户的账号命名的。
# The user's home directory. In Linux, each user has a directory of his or her own, which is usually named after the user's account.
│   └── yahboom        # 用户 # Users
│       ├── Desktop    # 桌面 # Desktop
│       ├── Documents  # 文档 # Document
│       ├── Downloads  # 下载 # Download
│       ├── Music      # 音乐 # Music
│       ├── Pictures   # 图片 # Pictures
│       ├── Public     # 共享 # Shared
│       ├── Templates  # 模板 # Templates
│       ├── Videos     # 视频 # Video
│       ...
│   ... 
├── lost+found   # 这个目录一般情况下是空的,当系统非法关机后,这里就存放了一些零散文件。
# This directory is normally empty, and when the system is shut down illegally, bits and pieces of files are stored here.
├── lib          # 存放共享的库文件,包含许多被/bin和/sbin中程序使用的库文件。
 # Stores shared library files, containing many libraries used by programs in /bin and /sbin.
├── media        # ubuntu系统自动挂载的光驱、usb设备,存放临时读入的文件。
  # Optical drive, usb device automatically mounted by ubuntu system to store temporary read-in files.
├── mnt          # 作为被挂载的文件系统得挂载点。
  # Mount point for the mounted file system.
├── opt          # 作为可选文件和程序的存放目录,主要被第三方开发者用来简易安装和卸载他们的软件。
# As a directory for optional files and programs, it is mainly used by third-party developers for easy installation and uninstallation of their software.
├── proc         # 这个目录是一个虚拟的目录,它是系统内存的映射,这里存放所有标志为文件的进程,比较cpuinfo存放cpu当前工作状态的数据。
  # This directory is a virtual directory which is a map of the system memory, where all processes marked as files are stored. compare cpuinfo stores data about the current operating status of the cpu.
├── root         # 该目录为系统管理员,也称作超级权限者的用户主目录。
# This directory is the user home directory for system administrators, also known as super-privileged individuals.
├── sbin         # s就是Super User的意思,这里存放的是系统管理员使用的系统管理程序,如系统管理、目录查询等关键命令文件。
# s means Super User, where system administration programs used by system administrators are stored, such as system administration, directory lookup and other key command files.
├── srv          # 存放系统所提供的服务数据。
# Store data on the services provided by the system.
├── sys          # 系统设备和文件层次结构,并向用户程序提供详细的内核数据信息。
 # System device and file hierarchies and provides detailed kernel data information to user programs.
├── usr          # 存放与系统用户有关的文件和目录。
 # Stores files and directories related to system users.
│   ├── bin      # 用户和管理员的标准命令
  # Standard commands for users and administrators
│   ├── games    # 存放着XteamLinux自带的小游戏
# Stores the games that come with XteamLinux.
│   ├── include  # 用来存放Linux下开发和编译应用程序所需要的头文件,c或者c++
# Used to store the header files, c or c++, needed to develop and compile applications under Linux.
│   ├── lib      # 应用程序和程序包的连接库
 # Connection libraries for applications and packages
│   ├── local    # 系统管理员安装的应用程序目录
# Directory of applications installed by the system administrator
│   ├── sbin     # 存放root超级用户使用的管理程序
 # Admin program for the root superuser
│   └── src      # Linux开放的源代码 
# Linux open source code
│   └── share    # 存放共享数据   # Store shared data
│   ...
├── var          # 长度可变的文件,尤其是些记录数据,如日志文件和打印机文件。
 # Files of variable length, especially logged data such as log files and printer files.
│   ├── backups
│   ├── cache    # 应用程序缓存目录
# Application cache directory
│   ├── crash    # 系统错误信息 # System error messages
│   ├── log      # 日志文件  # Log files
│   ├── mail     # 电子邮件 # E-mail
│   └── tmp      # 临时文件目录
# Directory of temporary documents
│   ...
├── tmp          # 这个目录是用来存放一些临时文件的,所有用户对此目录都有读写权限。
# This directory is used to store temporary files, and all users have read and write access to this directory.
... 

2.4 Common Commands

2.4.1 Add

New file

xxxxxxxxxx
touch test.txt

New Folder

xxxxxxxxxx
mkdir test         # 创建一个文件   # Create a file
mkdir -p test/src  # 创建test文件夹,并在test文件夹中创建src文件夹
# Create the test folder and create the src folder in the test folder

make a copy of

xxxxxxxxxx
sudo cp test.txt test_copy.txt  # 复制一个文件
# Copy a file

2.4.2 Delete

-iin an interactive manner
-fForced deletion, ignoring non-existing files without prompting
-rDelete the contents of a directory recursively
xxxxxxxxxx
sudo rm test.txt    # 删除文件 | 空文件夹
# Delete Files | Empty Folders
sudo rm -r test     # 删除文件夹及文件夹里的内容
 # Delete folders and their contents

2.4.3. Change

  • mv move, rename
xxxxxxxxxx
sudo mv test test_new          # 将test文件夹修改为test_new
  # Change test folder to test_new
sudo mv test.txt test_new.txt  # 将test.txt文件修改为test_new.txt
 # Change the file test.txt to test_new.txt
  • chmod modifies file permissions

Permission settings

symbolicmeaning
+increase authority
-revoke authority
=Setting permissions

rwx

letter authoritymeaning
rread means readable permissions, for a directory, if there is no r permission, then it means that you can't view the contents of this directory through ls.
wwrite denotes writable permissions, for a directory, if there is no w permission, then it means that no new files can be created in the directory.
xexcute denotes executable permissions, for a directory without x permissions, it means that the directory cannot be accessed by cd.
xxxxxxxxxx
sudo chmod +rwx test.txt  

Add shortcuts to all permissions

xxxxxxxxxx
sudo chmod 777 test.txt  
  • Modify password

Setting the root password

xxxxxxxxxx
sudo passwd root

Set user name and password

xxxxxxxxxx
sudo passwd 用户名

2.4.4. Check

  • Check the system version
xxxxxxxxxx
lsb_release -a     # 发行版本号# Release version number
uname -a           # 内核版本及系统位数
# Kernel version and system bits
cat /proc/version  # 内核版本及gcc版本
 # Kernel version and gcc version
  • Viewing Hardware Information
​x
curl cip.cc 或者 ifconfig    # 查看IP地址
# View IP address
cat /proc/cpuinfo or lscpu  # cpu信息
# cpu information
sudo dmidecode -t memory    # 内存信息
 # Memory information
df -h                       # 查看所有挂载的文件系统空间情况
 # View space on all mounted file systems
which python3               # 查看命令位置
 # View command location
v4l2-ctl --list-formats-ext # 查看相机设备参数
# View camera device parameters
nproc                       # 查看内核数
  # View kernel count
​
  • View file information
xxxxxxxxxx
la             # 显示指定目录下所有子目录与文件,包括隐藏文件
 # Display all subdirectories and files in the specified directory, including hidden files.
ll             # 以列表方式显示文件的详细信息  
 # Display file details in a list  
ls -h          # 配合以人性化的方式显示文件大小
 # Work with displaying file sizes in a user-friendly way
cat test.txt   # 查看文件内容
 # View the contents of the file
tree           # 查看文件目录(需要安装tree)
 # View file directories (requires tree to be installed)

The tree installation command

xxxxxxxxxx
sudo apt install tree
  • Find a file
xxxxxxxxxx
find ./ -name test.sh   # 查找当前目录下所有名为test.sh的文件or目录
# Find all files or directories named test.sh in the current directory
find ./ -name '*.sh'    # 查找当前目录下所有后缀为.sh的文件or目录
# Find all files or directories in the current directory with the extension .sh
find ./ -name "[A-Z]*"  # 查找当前目录下所有以大写字母开头的文件or目录
# Find all files or directories in the current directory that begin with an uppercase letter

2.4.5. Other

  • The tar command

The format of tar is as follows: tar [parameter] Packaging filename file

xxxxxxxxxx
-c  # 生成档案文件,创建打包文件
# Generate archive files, create packaged files
-v  # 列出归档解档的详细过程,显示进度
# List the details of the archive unarchiving process, showing progress
-f  # 指定档案文件名称,f后面一定是.tar文件,所以必须放选项最后
# Specify the name of the archive file, f must be followed by a .tar file, so it must be placed at the end of the options.
-t  # 列出档案中包含的文件
# List the files contained in the archive
-x  # 解开档案文件   # Unlock the archive file

pack

xxxxxxxxxx
tar -cvf xxx.tar *                # 当前目录所有文件
# All files in current directory
tar -cvf xxx.tar *.txt            # 以.txt结尾的文件 
  # Files ending in .txt 
tar -cvf xxx.tar my-file my-dir   # 打包指定目录或文件
# Pack the specified directory or file

unpack

xxxxxxxxxx
tar -xvf xxx.tar             # 解包到当前目录
 # Unpack to current directory
tar -xvf xxx.tar -C my-dir   # 解包到指定目录(需要先创建my-dir目录)
 # Unpack to a specified directory (you need to create the my-dir directory first)
  • zip, unzip commands

Zip file: zip [-r] target file (no extension) source file

xxxxxxxxxx
zip bak *       # 当前目录所有文件,也可以指定文件
 # All files in the current directory, or you can specify a file
zip -r bak *    # 当前目录所有文件&目录递归
 # All files in the current directory & directory recursion

Unzip files: unzip -d Unzip directory files Compressed files

xxxxxxxxxx
unzip -d ./target_dir bak.zip  # 解压到指定目录
# Unzip to a specified directory
unzip bak.zip                  # 解压到当前目录
# Unzip to the current directory
  • The ln command

Soft links: Soft links do not take up disk space, and they become invalid when the source file is deleted. Commonly used, can be created for files or folders

xxxxxxxxxx
ln -s Source file    Link file

Hard links: Hard links can only link normal files, not directories. Even if the source file is deleted, the linked file still exists

xxxxxxxxxx
ln Source file    Link file
  • scp remote copy
xxxxxxxxxx
scp jetson@192.168.16.66:/home/jetson/xxx.tar.gz /home/yahboom/ # 从远程复制文件到本地
    # Copy files from remote to local
scp /home/yahboom/xxx.png jetson@192.168.16.66:/home/jetson/    # 从本地复制文件到远程  # Copy files from local to remote
scp -r jetson@192.168.16.66:/home/jetson/test /home/yahboom/    # 从远程复制目录到本地 -r
    # Copy directory from remote to local -r
scp -r /home/yahboom/test jetson@192.168.16.66:/home/jetson/    # 从本地复制目录到远程 -r   # Copy directory from local to remote -r
  • wget file download

Search a random image address in Baidu as an example.

xxxxxxxxxx
wget "https://img0.baidu.com/it/u=3911542037,2006161295&fm=224&fmt=auto&gp=0.jpg"                 # 下载普通文件(百度链接要加双引号) 
 # Download common files (Baidu links should be in double quotes)
wget -O yahboom.jpg "https://img0.baidu.com/it/u=3911542037,2006161295&fm=224&fmt=auto&gp=0.jpg"  # 以指定文件名保存文件
 # Save the file with the specified filename
  • other
xxxxxxxxxx
nautilus .          # 打开当前文件 
# Open the current file
cd ~                # 切换到当前用户的主目录(/home/用户目录)
# Switch to the current user's home directory (/home/user directory)
cd .                # 切换到当前目录
  # Switch to the current directory
cd -                # 可进入上次所在的目录
  # Go to the last directory you were in
cd /                # 切换到系统根目录/
  # Switch to the system root directory /
pwd                 # 显示当前路径
# Display the current path
echo "HelloWorld"   # 向控制台输出HelloWorld信息
 # Output HelloWorld messages to the console
which               # 查看命令位置
# View command location

2.5 Editor

2.5.1 vim

vim is the upgraded version of vi, the most common difference is that it can display some special information of system files in various colors.

  • Installation commands
xxxxxxxxxx
sudo apt install vim
  • Three main models

Command Mode (Edit Mode): Default mode, move cursor, cut/paste text (interface performance: the lower left corner displays the file name or is empty) Insert Mode (Input Mode): Modify text (interface performance: the lower left corner shows -INSERT-) Insert Mode, press ESC to return to Command Mode. Last line mode (extended mode): save, exit, etc. (interface performance: the lower left corner displays -VISUAL-) under the last line mode, press the ESC key twice consecutively to return to the last line mode.

  • Mode switching

Command Mode to Edit Mode

xxxxxxxxxx
i    # 插入方式进入编辑模式
# Insertion into edit mode
a    # 追加方式进入编辑模式
# Add-on to edit mode
o    # 当前行下一行开始位置开始编辑
# Start editing at the beginning of the next line below the current line
O    # 当前行上一行开始位置开始编辑
# Start editing at the beginning of the line above the current line

Command mode switches to last line mode

xxxxxxxxxx
:     # 输入冒号【:】# Enter a colon [:]

End-of-line mode to command mode: Press [esc].

Edit mode switch to command mode: press [esc]

Esc build: exit to current mode

Esc build Esc build: always return to command mode

vim

  • terminal phase
xxxxxxxxxx
w           # 保存 # Save
q           # 退出 # Exit
q!          # 强制退出# Force exit
x           # 保存并退出# Save and exit
set nu      # 显示行号# Display line number
set         # nonu 隐藏行号# nonu Hide line numbers
0,$d        # vim 删除文件全部内容:  
  # vim deletes the entire contents of a file.  
/string     # 从光标处开始向后寻找字符串string;按n定位下一个,shfit+n定位上一个。
 # Find the string string backwards from the cursor; press n to locate the next one, shfit+n to locate the previous one.
g/string    # 检索string。使光标停止在第一个检索到的 string 串的行首。
# Retrieves the string. stops the cursor at the beginning of the first retrieved string.
  • command mode
xxxxxxxxxx
yy        # 复制 # Copy
p         # 粘贴# Paste
3yy       # 复制3行  # Copy 3 lines
2p        # 粘贴2遍# Paste 2 times
dd        # 剪切# Cut
3dd       # 剪切3行# Cut 3 rows
u         # 撤销 # Withdrawn
Ctrl + r  # 反撤销# Anti-revocation
dd        # 删除当前行 # Delete the current line
dG        # 删除当前行到文件末尾
# Delete the current line to the end of the file
dH        # 删除当前行到文件开头
 # Delete the current line to the beginning of the file
gg        # 跳到当前文档首行
# Jump to the first line of the current document
G         # 跳到当前文档末行
# Jump to the last line of the current document
^         # 跳到当前行首
 # Jump to the beginning of the current line
$         # 跳到当前行尾
  # Jump to the end of the current line
h         # 左移一个字符
# Shift one character to the left
j         # 下移一行
  # Move down a line
k         # 上移一行
 # Move up one line
l         # 右移一个字符
# Shift one character to the right
PageDown(or Ctrl+F)  # 下翻一屏 
# Scroll down one screen
PageUp(or Ctrl+B)    # 上翻一屏
# Flip up a screen

2.5.2 nano

nano is a text editor for Unix and Unix-like systems that is a copy of Pico.

  • Installation
xxxxxxxxxx
sudo apt install nano

New/open file

xxxxxxxxxx
nano Path + filename
Example: nano test_nano.txt

control command

xxxxxxxxxx
Ctrl+v     # 下一页# Next page
Ctrl+y     # 上一页# Previous page
Ctrl+w     # 搜索单词或短语
# Search for words or phrases
Ctrl+x     # 关闭当前文本,退出nano,返回shell
# Close the current text, exit nano, return to shell
Ctrl+\     # 搜索替换# Search replacements
Ctrl+k     # 剪切文本行# Cut lines of text
Ctrl+u     # 粘贴文本行 # Paste lines of text
Ctrl+c     # 显示光标在文本中的位置
 # Display the position of the cursor in the text

2.5.3 gedit

gedit is not much different from Notepad in Windows.

In the editor, we can click the "Open" button to browse the list of recently opened files and open the file; click the "Save" button to save the file you are currently editing; click the menu bar on the right side to do more operations and so on. The shortcut keys are the same as in windows:

xxxxxxxxxx
Ctrl + s           保存文件 Save file
Ctrl + Shift + s   另存为   save as
Ctrl + f           搜索文本内容   Search text content

The gedit editor must be started in a situation where it can display the interface, not ssh, jupyter, putty and other remote start without interface.

2.6 Ubuntu software operation commands

xxxxxxxxxx
sudo apt-get update                            # 更新源 # Update the source
sudo apt-get install package                   # 安装包 # Installation packages
sudo apt-get remove package                    # 删除包# Delete packages
sudo apt-cache search package                  # 搜索软件包 # Search for packages
sudo apt-cache show package                    # 获取包的相关信息,如说明、大小、版本等
# Get information about the package, such as description, size, version, etc.
sudo apt-get install package --reinstall       # 重新安装包# Reinstall the package
sudo apt-get -f install                        # 修复安装# Repair installation
sudo apt-get remove package --purge            # 删除包,包括配置文件等
# Delete packages, including configuration files, etc.
sudo apt-get build-dep package                 # 安装相关的编译环境
# Install the relevant compilation environment
sudo apt-get upgrade                           # 更新已安装的包 # Update installed packages
sudo apt-get dist-upgrade                      # 升级系统 # Upgrade the system
sudo apt-cache depends package                 # 了解使用该包依赖那些包
# Understand which packages are dependent on the use of this package
sudo apt-cache rdepends package                # 查看该包被哪些包依赖
  # See which packages this package depends on
sudo apt-get source package                    # 下载该包的源代码
# Download the source code for the package
sudo apt-get clean && sudo apt-get autoclean   # 清理无用的包# Clean up useless packages
sudo apt-get check                             # 检查是否有损坏的依赖
  # Check for corrupted dependency packages

 

Virtual Machines
Remote control

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文