ubuntu command line search

This article is automatically synchronized by Tencent Cloud + Community, the original address is https://stackoverflow.club/article/quick_seach_in_cli_ubuntu/

1. Find file name#

1.1 find command##

find -follow | grep file_name

1.2 mlocate command##

mlocate file_name

This is a quick file search command that comes with ubuntu. The principle is the same as everything on the windows platform. It temporarily stores the file name in the database and reads it directly from the database when searching.

Update database

sudo updatedb

Database address

/var/lib/mlocate/mlocate.db

2. Find file content#

Recursively find the contents of files in the current directory

grep -r 'keyword'.

Recommended Posts

ubuntu command line search
Ubuntu command line displays Chinese
Ubuntu Server Chapter 2 Command Line Basics
The locate file search command in Ubuntu16.04
Ubuntu16.04 common command notes
Use the command line to detect the Ubuntu version method