SlideShare a Scribd company logo
1 of 8
Download to read offline
Confidentiality Statement
This document contains confidential information of Tata Consultancy Services
Limited, which is provided for the sole purpose of permitting the recipient to
evaluate the proposal submitted herewith. In consideration of receipt of this
document, the recipient agrees to maintain such information in confidence and to
not reproduce or otherwise disclose this information to any person outside the
group directly responsible for evaluation of its contents, except that there is no
obligation to maintain the confidentiality of any information which was known to
the recipient prior to receipt of such information from Tata Consultancy Services
Limited, or becomes publicly known through no fault of recipient, or is received
without obligation of confidentiality from a third party owing no obligation of
confidentiality to Tata Consultancy Services Limited.
Tata Code of Conduct
We, in our dealings, are self-regulated by a Code of Conduct as enshrined in the
Tata Code of Conduct. We request your support in helping us adhere to the Code
in letter and spirit. We request that any violation or potential violation of the Code
by any person be promptly brought to the notice of the Local Ethics Counselor or
the Principal Ethics Counselor or the CEO of TCS. All communication received in
this regard will be treated and kept as confidential.
TATA CONSULTANCY SERVICES
vILP – CPP – Operating System
Command for searching files Version 1.1
July 2015
(ILP Guwahati)
Table of Content
1.1. Find ......................................................................................................................................................5
TCS Internal 4
Find command
The command find is one of the powerful utility of Unix (or Linux). It can search
the entire file-system to locate files and directories according to the specific
search criteria. Other than searching files in can perform actions(executing
commands) on searched files.
Syntax:
Examples :
1 . File Type based Search:
>> The following command finds the file named Abc in current(.) directory and
all its sub-directories
>> To find a directory named bin from root (/) directory and all its sub-directo-
ries the command will be :
The -type d option searches for the file of type directory
TCS Internal 5
$ find <search-in directory> <search-parameter> <action>
[390119@InGhyUnix ~]$ find . -name Abc
./Abc
./Dir1/Abc
[390119@InGhyUnix ~]$find / -name bin -type d
/bin
/usr/bin
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/bin
2 . Wild-Card based Search : Wild-card characters like * and ? can be used:
>> To find all files where filename starts with Abc the command will be:
>> The following command finds all files with three character extension ended
with t.
3 . Source Location based Search
>>The command find can search in multiple source location :
Searches for the file Abc with any extension only in directories Dir1 and Dir2
TCS Internal 6
[390119@InGhyUnix ~]$ find . -name "Abc*"
./Abc
./Dir1/Abc
./Dir1/Abc.php
./Abc.txt
./Abc.dat
[390119@InGhyUnix ~]$ find . -name "Abc.??t"
./Abc.txt
./Abc.dat
[390119@InGhyUnix ~]$ find Dir1 Dir2 -name "Abc.*"
Dir1/Abc.php
Dir2/Abc.htm
4 . Size Based Search : Using find files can be searched based on its size .
>> To find the files with size more than 10Mb the command will be
>> To find the files with size smaller than 2048 bytes the command will be
5 . Access/Modification-Time Based Search : Using find files can be searched
based on the time of last access/modification :
>> To find the files which are accessed within last 3 days the command will be
>> To find the files which are not modified within last 30 minute the command
will be
TCS Internal 7
[390119@InGhyUnix ~]$ find . -size +10M
./Abc.dat
[390119@InGhyUnix ~]$ find . -size -2048c
./Abc
./Abc.txt
[390119@InGhyUnix ~]$ find . -atime -3
./Abc
[390119@InGhyUnix ~]$ find . -not -mmin -30
./Abc.txt
6 . Permission Based Search : Using find command files can be searched
based on the access permission they have
>> To find the files having read write and execute permission only for the own-
er the command will be :
7 . Perform Action on the search result : Using exec option any action (com-
mand) can be executed on the search result.
>> To remove all the files having extension .swp from the current directory the
command will be :
TCS Internal 8
[390119@InGhyUnix ~]$ find . -perm 700
./Abc.txt
[390119@InGhyUnix ~]$ find . -name “*.swp” -exec rm {} ;

More Related Content

Similar to 4_Unix_Command_Usage_-_3

Hhs en05 system_identification
Hhs en05 system_identificationHhs en05 system_identification
Hhs en05 system_identificationShoaib Sheikh
 
Description Of A Network Administrator
Description Of A Network AdministratorDescription Of A Network Administrator
Description Of A Network AdministratorGina Alfaro
 
Meterpreter awareness
Meterpreter awarenessMeterpreter awareness
Meterpreter awarenessHaydn Johnson
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocolD bipul lomga
 
Arama Motoru Geliyoo'nun düzenlemesi hakkında.
Arama Motoru Geliyoo'nun düzenlemesi hakkında.Arama Motoru Geliyoo'nun düzenlemesi hakkında.
Arama Motoru Geliyoo'nun düzenlemesi hakkında.Buray Anil
 
(130316) #fitalk bit torrent protocol
(130316) #fitalk   bit torrent protocol(130316) #fitalk   bit torrent protocol
(130316) #fitalk bit torrent protocolINSIGHT FORENSIC
 
Bit torrent protocol by milan varia
Bit torrent protocol by milan variaBit torrent protocol by milan varia
Bit torrent protocol by milan variaMilan Varia
 
Torrent Protocol
Torrent ProtocolTorrent Protocol
Torrent ProtocolHarsht2888
 
Project_report_BitTorrent
Project_report_BitTorrentProject_report_BitTorrent
Project_report_BitTorrentSrikanth Vanama
 
Bit Torrent Technology
Bit Torrent TechnologyBit Torrent Technology
Bit Torrent Technologyguestc67adeb
 
File System Implementation & Linux Security
File System Implementation & Linux SecurityFile System Implementation & Linux Security
File System Implementation & Linux SecurityGeo Marian
 
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]Krisman Tarigan
 
Secure File Sharing on Cloud
Secure File Sharing on CloudSecure File Sharing on Cloud
Secure File Sharing on CloudSupriya .
 
Filebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptxFilebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptxKnoldus Inc.
 

Similar to 4_Unix_Command_Usage_-_3 (20)

Bit torrent and tracker
Bit torrent and trackerBit torrent and tracker
Bit torrent and tracker
 
Level 4
Level 4Level 4
Level 4
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Hhs en05 system_identification
Hhs en05 system_identificationHhs en05 system_identification
Hhs en05 system_identification
 
Description Of A Network Administrator
Description Of A Network AdministratorDescription Of A Network Administrator
Description Of A Network Administrator
 
Meterpreter awareness
Meterpreter awarenessMeterpreter awareness
Meterpreter awareness
 
Find and locate
Find and locateFind and locate
Find and locate
 
Bit torrent protocol
Bit torrent protocolBit torrent protocol
Bit torrent protocol
 
Arama Motoru Geliyoo'nun düzenlemesi hakkında.
Arama Motoru Geliyoo'nun düzenlemesi hakkında.Arama Motoru Geliyoo'nun düzenlemesi hakkında.
Arama Motoru Geliyoo'nun düzenlemesi hakkında.
 
(130316) #fitalk bit torrent protocol
(130316) #fitalk   bit torrent protocol(130316) #fitalk   bit torrent protocol
(130316) #fitalk bit torrent protocol
 
Bit torrent protocol by milan varia
Bit torrent protocol by milan variaBit torrent protocol by milan varia
Bit torrent protocol by milan varia
 
Torrent Protocol
Torrent ProtocolTorrent Protocol
Torrent Protocol
 
Project_report_BitTorrent
Project_report_BitTorrentProject_report_BitTorrent
Project_report_BitTorrent
 
Bit Torrent Technology
Bit Torrent TechnologyBit Torrent Technology
Bit Torrent Technology
 
Registry forensics
Registry forensicsRegistry forensics
Registry forensics
 
File System Implementation & Linux Security
File System Implementation & Linux SecurityFile System Implementation & Linux Security
File System Implementation & Linux Security
 
Torrent technology
Torrent technologyTorrent technology
Torrent technology
 
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
18587936 squid-proxy-configuration-guide - [the-xp.blogspot.com]
 
Secure File Sharing on Cloud
Secure File Sharing on CloudSecure File Sharing on Cloud
Secure File Sharing on Cloud
 
Filebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptxFilebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptx
 

4_Unix_Command_Usage_-_3

  • 1. Confidentiality Statement This document contains confidential information of Tata Consultancy Services Limited, which is provided for the sole purpose of permitting the recipient to evaluate the proposal submitted herewith. In consideration of receipt of this document, the recipient agrees to maintain such information in confidence and to not reproduce or otherwise disclose this information to any person outside the group directly responsible for evaluation of its contents, except that there is no obligation to maintain the confidentiality of any information which was known to the recipient prior to receipt of such information from Tata Consultancy Services Limited, or becomes publicly known through no fault of recipient, or is received without obligation of confidentiality from a third party owing no obligation of confidentiality to Tata Consultancy Services Limited.
  • 2. Tata Code of Conduct We, in our dealings, are self-regulated by a Code of Conduct as enshrined in the Tata Code of Conduct. We request your support in helping us adhere to the Code in letter and spirit. We request that any violation or potential violation of the Code by any person be promptly brought to the notice of the Local Ethics Counselor or the Principal Ethics Counselor or the CEO of TCS. All communication received in this regard will be treated and kept as confidential. TATA CONSULTANCY SERVICES
  • 3. vILP – CPP – Operating System Command for searching files Version 1.1 July 2015 (ILP Guwahati)
  • 4. Table of Content 1.1. Find ......................................................................................................................................................5 TCS Internal 4
  • 5. Find command The command find is one of the powerful utility of Unix (or Linux). It can search the entire file-system to locate files and directories according to the specific search criteria. Other than searching files in can perform actions(executing commands) on searched files. Syntax: Examples : 1 . File Type based Search: >> The following command finds the file named Abc in current(.) directory and all its sub-directories >> To find a directory named bin from root (/) directory and all its sub-directo- ries the command will be : The -type d option searches for the file of type directory TCS Internal 5 $ find <search-in directory> <search-parameter> <action> [390119@InGhyUnix ~]$ find . -name Abc ./Abc ./Dir1/Abc [390119@InGhyUnix ~]$find / -name bin -type d /bin /usr/bin /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/bin
  • 6. 2 . Wild-Card based Search : Wild-card characters like * and ? can be used: >> To find all files where filename starts with Abc the command will be: >> The following command finds all files with three character extension ended with t. 3 . Source Location based Search >>The command find can search in multiple source location : Searches for the file Abc with any extension only in directories Dir1 and Dir2 TCS Internal 6 [390119@InGhyUnix ~]$ find . -name "Abc*" ./Abc ./Dir1/Abc ./Dir1/Abc.php ./Abc.txt ./Abc.dat [390119@InGhyUnix ~]$ find . -name "Abc.??t" ./Abc.txt ./Abc.dat [390119@InGhyUnix ~]$ find Dir1 Dir2 -name "Abc.*" Dir1/Abc.php Dir2/Abc.htm
  • 7. 4 . Size Based Search : Using find files can be searched based on its size . >> To find the files with size more than 10Mb the command will be >> To find the files with size smaller than 2048 bytes the command will be 5 . Access/Modification-Time Based Search : Using find files can be searched based on the time of last access/modification : >> To find the files which are accessed within last 3 days the command will be >> To find the files which are not modified within last 30 minute the command will be TCS Internal 7 [390119@InGhyUnix ~]$ find . -size +10M ./Abc.dat [390119@InGhyUnix ~]$ find . -size -2048c ./Abc ./Abc.txt [390119@InGhyUnix ~]$ find . -atime -3 ./Abc [390119@InGhyUnix ~]$ find . -not -mmin -30 ./Abc.txt
  • 8. 6 . Permission Based Search : Using find command files can be searched based on the access permission they have >> To find the files having read write and execute permission only for the own- er the command will be : 7 . Perform Action on the search result : Using exec option any action (com- mand) can be executed on the search result. >> To remove all the files having extension .swp from the current directory the command will be : TCS Internal 8 [390119@InGhyUnix ~]$ find . -perm 700 ./Abc.txt [390119@InGhyUnix ~]$ find . -name “*.swp” -exec rm {} ;