zoukankan      html  css  js  c++  java
  • ubuntu how to locate what you want (the path, the file etc.)

    part 1  find the path

    the first 5 ways are excuted with terminals, the 6-th is gui, the 7-th varies.

    Based on the pipiline tech, the 'grep' can be combined with all the following ways.

    1 dpkg show the installed packages (only packages by the synaptic manager usually .deb type)

     first, we should know the organized structure of linux distributions. In Linux distributions, a “package” refers to a compressed file archive containing all of the files that come with a particular application. The files are usually stored in the package according to their relative installation paths on your system. Most packages also contain installation instructions for the OS, as well as a list of any other packages that are dependencies (prerequisites required for installation.

    Common types of Linux packages include .deb, .rpm, and .tgz. Since Linux packages do not usually contain the dependencies necessary to install them, many Linux distributions use package managers that automatically read dependencies files and download the packages needed before proceeding with the installation. Some examples of package managers are APT, YUM, and Pacman.

    ex 

    dpkg -s dpkg | grep Status
    Status: install ok installed

    more detail:http://www.cyberciti.biz/howto/question/linux/dpkg-cheat-sheet.php

    2 whereis: locate the binary, source, and manual page files for a command

    ex whereis *python*

    3 which :locate a command; returns the pathnames of the files (or links) which would be executed in the current environment,

    4 locate 

    Locate is used more like a keyword-based search function.

    ex locate java ;  the returned result is large

    5 find : search for files in a directory hierarchy

    ex :  find / -xdev -type f -a -name 'java*'

    compared with 4, this way has connection with the directory 

    6 gui such as

     6.1 places->search for files->input the keywords and set the folder

    6.2 the synaptic manager search

    7 other tools such as 

    xfce4-appfinder

    Beagle

    part 2 find special text string with some known information

    1 grep : print lines matching a pattern

    http://vim.wikia.com/wiki/Find_in_files_within_Vim

    2 ctags+cscope

    3 global

    etc....

    here thanks to Mr. Wu 





  • 相关阅读:
    node.js ---path模块
    es6箭头函数this问题
    Codeforces Round #576 (Div. 2) | CF1199 补题
    Hungary
    CF 1196D2 RGB Substring (hard version) --- 前缀和 + 思维
    康托展开
    POJ1821 Fence --- 单调队列 + DP
    素数筛
    自动化接口面试遇到的问题
    linux遇到的面试问题
  • 原文地址:https://www.cnblogs.com/18fanna/p/3102663.html
Copyright © 2011-2022 走看看