Please download the pokemon zip package, from here and extract the files in the folder with name pokemon
.
tree -a pokemon/
pokemon/
├── dump.txt
├── eevee
│ ├── espeon
│ │ └── README.md
│ ├── flareon
│ ├── leafeon
│ └── README.md
├── LICENSE.md
├── pickachu
│ ├── raichu
│ │ └── README.md
│ └── README.md
├── README.md
└── snorlax
├── dump.txt
└── README.md
7 directories, 9 files
- name
- type
- f - regular file
- d - directory
find ./pokemon/ -name README.md
finds the files with the name README.md in pokemon
folder
find ./pokemon/pickachu/ -name README.md
finds the files with the name README.md in pickachu
folder
find ./pokemon/ -name *.md
finds the files with the file extension .md
find ./pokemon/ -name dump.txt
finds the files with the name dump.txt
find ./pokemon/ -name dump.txt -exec rm -i {} \;
deletes the files with the name dump.txt in pokemon
rm: remove regular empty file './pokemon/snorlax/dump.txt'? y
find ./pokemon/ -type f
finds all the files
find ./pokemon/ -type d
finds all the directories
find ./pokemon/ -empty
finds all the empty files and directories
find ./pokemon/ -type d -empty
finds all the empty directories
find ./pokemon/ -type f -name "*.md" -exec grep 'pokemon' {} \;
finds all the files which has "pokemon" written in any files
mkdir session
cd session
echo 'one two three' | xargs mkdir
ls
creates three folders with names one
, two
, three
echo 'one two three' | xargs -t rm -rf
ls
deletes the three folders