📖
Wiki
Back to my personal website
  • Home
  • Equipment and Devices
    • 3D Printer
    • Laser Cutter
    • Motion Capture System
    • Sensors
      • RGB-D Cameras
      • Velodyne LiDAR
      • Zed Camera
      • RealSense D435i
      • IMU
    • eGPU
    • Nvidia AGX Xavier
    • CPU Benchmark
    • Installation Checklist
  • Development
    • Linux
      • Shell
      • GDB
      • Git
      • Tmux
      • Network
      • Tricks
      • Debug FAQ
    • CMake
      • Catkin Tools
      • CMakeLists
      • CMake Variables
      • CMake Commands
      • CMake: find_package()
    • ROS
      • Gazebo
      • wstool
      • roslaunch
      • rosbag
      • multi-threaded spinner
    • ROS2
      • Convert ROS1 bag to ROS2 bag
    • C++
      • C++ 11
      • C++ Examples
      • C++ Debug
      • Factory Method
      • Timing
    • Google Tools
      • GLog
      • GFlags
      • GTest
      • Style Guide
      • Clang Format
    • PCL
      • Point Type
      • Methods
      • Architecture
      • Code Explained
    • Open3D
      • Python API
      • Registration
      • Visualization
      • Tools
    • OpenCV
      • Documentation
      • Modules
    • Other Libraries
      • Eigen
      • Ceres
      • g2o
      • GTSAM
    • Website
  • Algorithm
    • SLAM
      • K-D Tree
      • Octree
      • Bag of Words
      • Distance Measures
      • Coordinate Systems
      • LOAM
      • Iterative Closest Point
      • Generalized ICP
      • Mahalanobis Distance
    • Computer Science
      • Computational Model
      • Sorting
      • Analysis
      • Complexity Classes (P, NP)
      • Divide and Conquer
      • Greedy Algorithm
      • Dynamic Programming
      • Tree
      • Graph
    • Computer Vision
      • Camera Models
      • Distortion
      • Motion Models
      • Shutter
      • Image Sensors
      • Epipolar Geometry
      • Multiple-View Geometry
    • Datasets
      • RGB-D Datasets
      • Point Cloud Datasets
      • LiDAR SLAM Datasets
  • Math
    • Optimization
      • Convex Optimization
      • Descent Methods
    • Probability
      • Moment
      • Covariance Matrix
      • Stochastic Process
    • Topology
      • References
      • Concepts
      • Topological Spaces
      • Representation of Rotations
      • Representation of 3-sphere
    • Algebra
      • Linear Algebra
      • Matrix Factorization
      • Condition Number
      • Matrix Lie Group
    • Differential Geometry
      • Manifold
      • Submanifold
      • Quotient Manifolds
      • Tangent Space
  • Quadrotor
    • PX4 Development
    • Companion Computer
    • Drone Hardware
    • Propeller Lock
    • Debug
  • Favorites
    • Bookmarks
Powered by GitBook
On this page
  • SSH
  • Devices and Filesystem
  • Environment Variables
  • Date and Time
  • Network
  • Compression
  • running in the background
  • apt commands to find dependencies (link)
  • apt commands to locate packages
  • vim commands
  • terminal
  • References

Was this helpful?

  1. Development
  2. Linux

Shell

SSH

  • ssh to see if ssh is installed (openssh-client is installed by default)

  • ssh-keygen or ssh-keygen -t rsa generate ssh key by RSA algorithm

  • cat ~/.ssh/id_rsa.pub print public key (for settings on Github)

  • ssh -T git@github.com testing

  • sudo apt-get install openssh-server install server for incoming ssh connections

  • ssh-copy-id username@hostname copy your ssh key to remote computer to avoid verifying password on every connection

  • ssh username@ip ssh login to a remote computer with this ip and username

  • ssh username@hostname if mapped this hostname to its ip in /etc/hosts file

  • ssh -X username@hostname login with GUI support

  • ssh -p 1234 username@hostname login via port 1234

  • sudo gedit /etc/hosts modify hosts file

  • sudo gedit /etc/ssh/sshd_config modify ssh server configuration

Devices and Filesystem

  • sudo gparted

  • ls -l /dev/ttyS0

  • groups <username>

  • sudo gpasswd -a <username> <groupname>

  • sudo gpasswd -d <username> <groupname>

  • sudo groupadd <newgroupname>

  • sudo usermod -a -G <groupname> <username>

  • lscpu , lsmem , lshw list CPU, memory, hardware info

  • lsusb list USB devices

  • lsblk list block devices, often used to check external ssd

  • lspci list PCI devices

  • lspci | grep VGA check GPUs

  • sudo lshw -C video check GPU display details

  • du -h -d 1 check file size/usage in current directory

  • df -h check hard disk usage

Environment Variables

  • which pip to see which pip command you are running - useful for checking environment!

  • uncomment #force_color_prompt=yes in .bashrc for a colored prompt

  • sudo !! where !! is for the last command

  • python3 -m site show searching path for python3

  • sudo ldconfig after sudo make install to refresh the cache

Date and Time

  • date

  • sudo systemctl stop systemd-timesyncd

  • sudo systemctl start systemd-timesyncd

  • timedatectl

  • sudo timedatectl set-ntp false

  • sudo timedatectl set-time 'YYYY-MM-DD'

  • sudo timedatectl set-time 'YYYY-MM-DD HH:MM:SS'

Network

  • sudo systemctl restart network-manager

  • nmap -sP 192.168.0.1/24 scan ports

  • nmap -A 192.168.10.112 detect OS and services

Compression

  • tar -cf filename.tar file1 folder2 packed without compression

  • tar -xf filename.tar create an archive by -c, extract an archive by -x

  • tar -cvzf filename.tar.gz file1 folder2 compress by -z; verbose by -v

  • tar -xvzf filename.tar.gz decompress

  • tar -xvzf filename.tar.gz -C {path} decompress to a designated path

  • sudo apt-get install zip unzip

  • zip -r archive_name.zip myfolder

  • unzip archive_name.zip

running in the background

  • Ctrl + Z to stop the process, followed by bg to run in the background or fg to run in the foreground.

  • Use command ./test.sh 1>stdout.log 2>stderr.log & and it will return a process ID.

  • Processes running in the background can be monitored by top command.

  • apt-cache showpkg <pkgname> show package info, both depends and reverse depends

  • apt-cache depends ros-melodic-desktop show one-level dependencies

  • apt-cache rdepends --installed ros-melodic-desktop

  • sudo apt install apt-rdepends

  • apt-rdepends ros-melodic-desktop | pager recursively show all dependencies

  • apt-rdepends --reverse protobuf-compiler | grep ros-melodic-desktop

apt commands to locate packages

  • dpkg -L <package-name>

  • apt list <package-name>

  • apt-cache madison

  • locate <filename> find a file in database (globally)

  • find <filename> find a file in local directory

vim commands

  • vi -b <filename> open file in binary mode

  • :%!xxd switch to hex mode

  • :%!xxd -r switch back to binary mode

  • :wq save and exit

terminal

  • sudo update-alternatives --config x-terminal-emulator

References

PreviousLinuxNextGDB

Last updated 1 year ago

Was this helpful?

sudo python -m pip install --force-reinstall pip==8.1.1 if you . More info can be found at , and .

apt commands to find dependencies ()

inadvertently upgraded your system pip
this link
this link
link
The Unix Shell
How do I find the reverse dependency of a package?