+1 votes
asked in Linux by (9.2k points)
edited by

We will list common SSH commands under this page

2 Answers

+2 votes
answered by (1.2k points)

How to find linux version?


  • Redhat and friends: Test for /etc/redhat-release, check contents
  • Debian: Test for /etc/debian_version, check contents
  • Mandriva and friends: Test for /etc/version, check contents
  • Slackware: Test for /etc/slackware-version, check contents

Etc. Generally speaking, check for /etc/*-release and /etc/*-version.

+3 votes
answered by (1.2k points)
How to find a file in linux

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"


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:

  • f: 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
Ask a Question
Welcome to WikiTechSolutions where you can ask questions and receive answers from other members of the community.

You can ask a question without registration.