Linux for QA/Testers find command with 20+ options |Linux Tutorial
Автор: ETL QA Labs
Загружено: 2021-07-16
Просмотров: 1878
Описание:
#ETL Testing
#etltesting #etlqalabs
find command in Linux
#find#Linux#Unix#ETL Testing#Data warehousing #Database testing
Usage of find command:
Find command is used to find the files or directory and perform subsequent operation. It supports searching by name, permission, owner, creation date, modification date.
To see the file system hierarchy of a directory
$ tree – a dirname
find command Syntax :
$ find directory options [ expression ]
1. Search a file with specific name.
$ find ./ETLTesting -name emp.txt
2. find files that don't match a pattern (-not)
--------------------------------------------
$ find . -type f -not -name "*.html"
3. Search a file with pattern.
$ find ./ETLTesting -name *.txt
4. How to find and delete a file with confirmation.
$ find $ find ./ETLTesting -name emp.txt -exec rm -i {} \;
5. Search for empty files and directories.
$ find ./ETLTesting -empty
6. Search for file with entered permissions.
$ find ./ETLTesting-perm 664
7. find and copy
find . -type f -name "employeedup.text" -exec cp {} ./FMCG \;
8. find . -type f -name "Foo*" -exec rm {} \; -- remove all "Foo*"files under current dir
find . -type d -name TCS -exec rm -r {} \; -- remove all subdirectory
9. Search text within multiple files.
$ find ./ -type f -name "*.txt" -exec grep ‘unix' {} \;
10. File all Hidden Files
$ find /ETLTesting -type f -name ".*"
11. To find all .txt files of user ubuntu and name with.txt directory.
$ find /ETLTesting -user ubuntu -iname "*.txt"
12. To find all the files which are modified 60 days back.
$ find / -mtime 60
13. To find all the files which are accessed 60 days back.
$ find / -atime 60
14.To find all the files which are modified more than 60 days back and less than
110 days.
$ find / -mtime +60 –mtime -110
15. To find all the files which are changed in the last 1 hour.
$ find / -cmin -60
16.To find all the files which are modified in the last 1 hour.
$ find / -amin -60
17. To find all the files which are greater than 5MB and less than 10MB.
$ find / -size +5M -size -10M
18. To find all 100MB files and delete them using one single command.
$ f
ind / -name “*.php” -type f -size +10M -exec rm -f {} \;
19. Find all .mp3 files with more than 5MB and delete them using one single command.
$ find / -type f -name *.php -size +5M -exec rm -i {} \;
20. Assuming that you want to find all files in the current directory with .sh and .txt file extensions, you can do this by running the command below:
find . -type f \( -name "*.text" -o -name "*.php" \) Hope you like my work , Please do consider to subscribe this channel and encourage me for bringing more and more video for you and do watch below playlists.
Unix/Linux series:
• Linux for Testers
ETL Testing:
• ETL Testing
SQL for Testers:
• SQL Tutorial for Beginners
Happy Learning!
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: