SSH find commands

In this article, we’ll cover the basic usage of the SSH find commands you can use in a Linux environment. You can easily find files and folders by type using this SSH command.  Usually, it’s syntax is:

find directory [options]

find by type using SSH

You can search for only files or folders with the following options:

find / -type d #finds directories
find / -type f #finds files

find by name

You can directly find a file by its name

find / -name "myFilename"

find by size

You can list all files that are larger than a given value

find / -size +2M #finds files above 2 megabytes
find / -size -2M #finds files below 2 megabytes

find and execute

You can run other commands on files that you find

find / -name "myFile" -exec chmod 0755 {} \; #changes the permissions of any file called myFile to 0755
  • 0 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

SSH ip command

If you wish to obtain information about your server’s IP on a Linux machine using SSH you can use...

SSH rm command

If you wish to remove a file or folder from your Linux system you can use SSH rm command. In this...

SSH echo command

One of the most useful commands in a Linux environment is echo. With it, you can provide output...

SSH history command

If you wish to find what commands you have previously executed in a Linux environment you can use...

SSH cd command

SSH cd command is mainly used to navigate in your Linux environment. In this article, we’ll show...

Powered by WHMCompleteSolution