Friday 1 July 2016

How to search file in linux find command

How to search file in Linux with find command

Syntax:
find <directory> -name <file-name>

Description: In place of '<directory>' place search directory and in place of '<file-name>' place search file.


Example 1:

find . -name  test.txt

Description 1:
In above command finds test.txt file in current directory( '.' represents current directory)


Example 2:

find . -name  test*

Description 1:
In above command finds files whose name starts with 'test' in current directory( '.' represents current directory)

How to use SSH command in linux?

Syntax:
ssh <user>@<IP>

Example 1:
 ssh root@192.168.1.1 

Example 2:
 ssh root@192.168.1.1 "cat /etc/fstab"

Description: In example2  "cat /etc/fstab" is directory

No comments:

Post a Comment