Linux view a file or a command location path

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_37189082/article/details/95019560

Many times there will be the following issues according to the information search operation

① modify or add configuration  file  contents, source file will run the modified error Error: No such file or directory (not the file or folder).

② according to location information, this path is not looking for  a folder  . The reason is that the system may be different, there are some small differences that you need to change the position or create your own.

 

1. Find which  command  location

    Position which is used to view the current location of the command to be executed

[xiaokang@localhost ~]$ which virtualenvwrapper.sh
/usr/bin/virtualenvwrapper.sh

   It will output virtualenvwrapper.sh command execution path that is the default setting of the PATH environment

 

2. Use the whereis locate the command or folder location of

[xiaokang@localhost ~]$ whereis nginx
nginx: /usr/sbin/nginx /usr/lib64/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz

It will output all with nginx file name or path location

 

These are encountered problem-solving lessons

Guess you like

Origin blog.csdn.net/qq_37189082/article/details/95019560