GitHub basic tutorial
  • Introduction
  • Khởi động hệ thống Ground station computer - Companion computer (Odroid) - Pixhawk
  • Tao 1 private Folder tu public Folder
  • Tạo folder dev PX4 code
  • PX4 modification
  • MAVROS modification
  • Tạo node I3S_receiver
  • Kết nối đọc dữ liệu trong Pixhawk
  • Terminal Linux Ubuntu
  • Kết nối ROS hai máy tính
  • Build ros package in Odroid
  • Pressure sensor
  • Kết nối camera oCAM trên ROS
  • Cài đặt và sử dụng Matlab 2017b trên Linux Ubuntu
  • Một vài vấn đề trên Windows 7
  • Terminator
  • Upload compiled firmware of Pixhawk from odroid
  • Kết nối internet và Ethernet với Odroid (qua Switch) và 1 card mạng kết nối internet
  • IMU, Camera, Pixhawk connection to odroid
  • Kết nối ssh
  • Tham khao code homography cua Ninad
  • Matlab_2017b_problems
  • Eigen library - Mathematical toolbox for C++
  • Kinh nghiệm chuẩn bị presentation
  • Tap lenh lam viec voi Pixhawk px4
  • Offboard mode in PX4
  • P51 Lenovo, trackpad and trackpoint
  • P51 Lenov, Install Quadro M2200 graphic card
  • Gilab
  • Tao 1 private Folder tu public Folder
  • Ubuntu tips: show desktop by pressing Super + D
  • Install eclipse
  • Windows error
  • How to update Sublime Text 3 in ubuntu 16.04
  • PX4 Pixhawk hardfault
  • Install CUDA for computer with NVIDIA graphic card
  • Install openCV after installing CUDA
  • Meld - tool for file or folder comparison
  • GIT - move a full git repository from one remote sever to another one
  • Jetson Nano Installation
  • Working in Jetson Nano
  • Backup and Restore micro sd card
Powered by GitBook
On this page
  • Tìm kiếm theo noi dung chua trong file trên Linux Ubuntu
  • Find a file
  • Finding by Name
  • Finding by Type
  • Ubuntu bash history with PageUp/PageDown

Was this helpful?

Terminal Linux Ubuntu

Tìm kiếm theo noi dung chua trong file trên Linux Ubuntu

You can search recursively i.e. read all files under each directory for a string “192.168.1.5”

$ grep -r "192.168.1.5" /etc/

Search for old command in ubuntu Terminal:

  1. set: sudo chown $USER:$USER ~/.bash_history

  2. Then can use Ctrl+r for searching

List all previous commands:

history

fc -l <linenumber> list all commands from line_number until the end

history | grep <string can tim kiem>

Find a file

Finding by Name

The most obvious way of searching for files is by name.

To find a file by name, type:

find -name "query"

This will be case sensitive, meaning a search for "file" is different than a search for "File".

To find a file by name, but ignore the case of the query, type:

find -iname "query"

If you want to find all files that don't adhere to a specific pattern, you can invert the search with "-not" or "!". If you use "!", you must escape the character so that bash does not try to interpret it before find can act:

find -not -name "query_to_avoid"

Or

find \! -name "query_to_avoid"

Finding by Type

You can specify the type of files you want to find with the "-type" parameter. It works like this:

find -type 
type_descriptor
query

Some of the most common descriptors that you can use to specify the type of file are here:

  • Finding by Typef: regular file

  • d: directory

  • l: symbolic link

  • c: character devices

  • b: block devices

For instance, if we wanted to find all of the character devices on our system, we could issue this command:

find / -type c
/dev/parport0
/dev/snd/seq
/dev/snd/timer
/dev/autofs
/dev/cpu/microcode
/dev/vcsa7
/dev/vcs7
/dev/vcsa6
/dev/vcs6
/dev/vcsa5
/dev/vcs5
/dev/vcsa4
. . .

We can search for all files that end in ".conf" like this:

find / -type f -name "*.conf"

Ubuntu bash history with PageUp/PageDown

In /etc/inputrc, uncomment:

# alternate mappings for "page up" and "page down" to search the history

"\e[5~": history-search-backward

"\e[6~": history-search-forward

Restart your shell or use Ctrl+X, Ctrl+R to tell it to re-read.

PreviousKết nối đọc dữ liệu trong PixhawkNextKết nối ROS hai máy tính

Last updated 5 years ago

Was this helpful?