Linux Hel Taliska Tusaalooyinka

Ma garanaysaa inta fayl ee ku jira rakib cusub oo Linux ah ? Haddii aad isticmaasho PopOS! Qaybinta Linux(Linux distribution) tusaale ahaan, waxaa jira in ka badan 31,000 oo fayl. Taasi waa ka hor inta aanad bilaabin abuurista dukumeenti kasta, kaydinta muusikada, soo dejinta PDFs , ama abaabulida sawirada.

Sababtaas awgeed, helitaanka faylka saxda ah ama faylka Linux marka aad u baahan tahay waxay noqonaysaa caqabad. Maqaalkan, waxaad ku baran doontaa sida loo isticmaalo amarka Linux FIND , waxaanan ku siin doonaa dhammaan tusaalooyinka aan awoodno.

Linux Find Command Syntax

Syntax waxa loola jeedaa sida erayada, ama amarrada, la isu geeyo. Sida(Just) jumlada caadiga ah ay u noqon karto wax aan macno lahayn marka la isku shaandheeyo kelmadaha, amarradu way fashilmi karaan haddii aan loo isticmaalin sida saxda ah.

hel [dariiqa] [shuruudaha] [falalka](find [path] [conditions] [actions])

Waa tan waxa taas macnaheedu yahay:

Find - waxay(find ) ku bilaabataa utility Find Linux

jidka(path ) - halkee la eegayaa

shuruudaha(conditions ) - doodaha aad rabto inaad ku dabaqdo raadinta

falalka(actions ) - waxa aad rabto in aad ku samayso natiijada

Tusaalaha fudud oo isticmaalaya dhammaan saddexda ayaa u eg:

heli . -name file-sample.rtf -print(find . -name file-sample.rtf -print)

Sidaad qiyaastay, tani waxay heli doontaa magaca faylka file-sample.rtf(file-sample.rtf)

Muddada ( . ) Waddadu waxay sheegaysaa in aad raadiso hagaha hadda jira iyo hagayaal kasta oo ku jira. 

Shardiga - magaca(-name ) ayaa sheegaya in la helo faylka magacaas gaarka ah leh.

Ficilka daabacaadda(-print ) ayaa u sheegaya FIND si ay u muujiso natiijooyinka shaashadda.

Muddada iyo -daabacadu waa khalad amarka raadinta. Markaa wali waxay samayn doontaa wax la mid ah haddii aadan isticmaalin. Markaa, Find -name file-sample.rtf waxay ku siin doontaa natiijooyin isku mid ah.

Linux ka hel Hagaha Kale(Linux FIND In Another Directory)

Waxaad ka raadin kartaa hage ka duwan kan aad ku jirto. Geli(Just) dariiqa tusaha ka dib hel(FIND) . Haddii aad xidid ku tahay oo aad ogtahay in feylku uu yaallo meel ka mid ah hagaha home/user

find home/user -name file-sample.rtf

Wali waa raadinta soo noqnoqota, markaa waxay mari doontaa hage kasta oo hoos yimaada isticmaalaha(user) .

Linux FIND Raadinta Hagaha Badan(Linux FIND Search Multiple Directories)

Haddii aad rabto in aad hal mar ka raadiso dhawr buug, kaliya ku tax taliska, oo ay kala soocday meel bannaan.

find /lib /var /bin -name file-sample.rtf

Linux FIND oo aan lahayn dib u soo noqnoqosho ama xaddidid soo noqnoqota(Linux FIND with No Recursion or Limiting Recursion)

Haddii aad isticmaashid amarka FIND ee kor ku xusan heerka xididka, waxay eegi doontaa hage kasta oo nidaamka. Markaa haddii aad rabto inaad ku dhegto tusaha hadda jira, isticmaal ikhtiyaarka -maxdepth . Lambarka ka dambeeya -maxdepth ayaa sheegaya Soo hel sida qoto dheer ee aad u socoto ka hor inta aanad joojin. 

Isticmaalka -maxdepth 1 waxay(-maxdepth 1 ) la macno tahay oo kaliya buuggan. 

Find -name file-sample.rtf -maxdepth 1

Isticmaalka -maxdepth 2 ama tirada ka weyn waxay la macno tahay in la sii qoto dheereeyo heerarkaas badan.

Find -maxdepth 5 -name file-sample.rtf

Linux FIND Wildcard Tusaalaha(Linux FIND Wildcard Example)

Amarka FIND waxa uu u adeegsadaa calaamadda ( * ) sidii calaamad duurjoog ah. U isticmaal qayb kasta oo magaca ah oo aadan hubin. Waxa loo isticmaali karaa in ka badan hal mar magaca. La'aanteed nooca faylka oo ah qayb ka mid ah magaca faylka, natiijooyinka waxa sidoo kale ku jiri doona hagayaal u dhigma.

find home/user -name file*sample*

Linux FIND oo ah Nooca Tusaalaha(Linux FIND by Type Example)

Si aad u raadiso kaliya faylka ama hagaha, isticmaal ikhtiyaarka -type iyo sharraxaha ku habboon. Waxaa jira dhowr, laakiin faylka iyo tusaha ayaa ah kuwa ugu badan:

f - fayl

d - hagaha

b - qalab xannibid

c - qalab dabeecad

l - isku xirka astaanta

s - godad

find home/user -name file*sample* -type d

Linux FIND Kiis Dareen la'aan Tusaalaha(Linux FIND Case Insensitive Example)

Si ka duwan Windows , Linux waxay danaysaa in xarafku yahay mid weyn iyo in kale. Markaa haddii aad rabto in aad raadiso File-Sample.rtf iyo file-sample.rtf labadaba, isticmaal ikhtiyaarka -inname(-iname ) .

find home/user -iname File-Sample.rtf

Linux ka hel Tusaalaha Faylal Dhowr ah(Linux FIND Several Files Example)

Aynu sheegno inaad rabtay inaad hesho .rtf iyo .html noocyada faylka. Taas waxaa lagu samayn karaa hal amar iyadoo la isticmaalayo -o (ama) hawlwadeenka. Qaar ka mid ah distros, waxaa laga yaabaa inaad u baahato inaad geliso magacyada gudaha dhejiska, sida (-name file-sample.rtf -o-name file-sample.html )

find home/user -name file-sample.rtf -o -name file-sample.html

Linux HEL Faylasha Aan Lahayn Magaca(Linux FIND Files That Don’t Match a Name)

Waxaa laga yaabaa inaad ogtahay inuu jiro nooca .html ee faylka, laakiin maaha haddii ay jiraan kuwa kale. Waxaad ka saari kartaa nooca .html raadinta adigoo isticmaalaya ikhtiyaarka -not .

find home/user -name file-sample* -not -name *.html

Linux Find Natiijooyin La'aan(Linux FIND Without Error Results)

Helitaanka oo aan lahayn tusaale soo noqnoqosho ah, ogaysii in ay taxday hage kasta oo aanay ka raadin karin iyo natiijada saxda ah. Taasi waa wax laga xumaado. Aan ka joojino inaan muujino dhammaan hagayaasha " Ogolaanshaha(Permission) la diiday". Ku darso amar kale oo Linux ah(Linux terminal command) , grep. Waxa kale oo aad isticmaali kartaa Find with grep si aad u hesho faylal ay ku jiraan ereyo gaar ah(find files with specific words in them) .

find -maxdepth 5 -name file-sample.rtf 2>&1 | grep -v “Permission denied”

Aan kala jebinno 2>&1 .

2 - waxay ka dhigan tahay stderr oo gaaban soo saarista khaladaadka caadiga ah. 

1 - waxay ka dhigan tahay stdout oo gaaban wax soo saarka caadiga ah

> - waxaa loola jeedaa in wax kasta oo ka soo baxa bidixda loo leexiyo wax kasta oo dhinaca midig ah.

& – waxaa loola jeedaa in la isu geeyo.

Markaa 2>&1 waxay ka dhigan tahay in aad qaado khaladaadka caadiga ah oo dib u habayn iyaga, ka dibna ku dheji halbeegga wax soo saarka.

Hadda aan eegno | grep -v “Permission denied” .

| (oo loo yaqaan tube) - wuxuu u sheegaa Linux inuu ku quudiyo natiijooyinka wax kasta oo bidixda ah ilaa wax kasta oo dhanka midig ah. Waxaa lagu quudinayaa taliska grep.

grep - waa utility raadinta qoraalka. 

-v – wuxuu u sheegaa grep inuu raadiyo wax kasta oo aan ku habboonayn qoraalka dhanka bidix ee -v. Xaaladdan oo kale, waxa ay u sheegaysaa grep in la helo kaliya wax aan ku jirin qoraalka ama xadhigga, " Ogolaanshaha(Permission) waa la diiday." Markaa grep ayaa kaliya ku tusi doonta natiijooyinka aad raadinayso iyo wixii khaladaad ah ee aan ku habboonayn " Oggolaanshaha(Permission) waa la diiday."

Linux FIND tusaale ahaan ogolaanshaha(Linux FIND by Permissions Example)

Si aad tan si fiican u isticmaasho, waxaad u baahan tahay inaad barato ogolaanshaha Linux(learn Linux permissions)

Tusaalaha faylasha dhamaantood waxay leeyihiin ogolaanshaha 664, marka laga reebo mid haysta ogolaanshaha 775. Isticmaal ikhtiyaarka -perm si aad u hesho.

find Documents/ -name file-sample* -type f -perm 775

Linux FIND marka la eego cabbirka Tusaalaha(Linux FIND by Size Example)

Helitaanka faylalka cabbir ahaan waxay waxtar u leedahay helitaanka faylashaas waaweyn ee buuxinaya darawalkaaga adag. Isticmaal ikhtiyaarka -size, cabbirka la rabo, iyo mid ka mid ah daba-galayaasha soo socda. Haddii aan la isticmaalin daba-gal, -size defaults to b . Si aad u hesho faylal la siman ama ka weyn cabbir cayiman, dhig calaamadda-dheer (+) ee cabbirka hortiisa.

M - Megabytes

G - Gigabyte

k - Kiiloobytes

b - blocks (512 bytes - default)

c - bytes

w - kelmado (laba bytes oo wadajira)

find -size +500k

Linux ka hel mulkiilaha(Linux FIND by Owner)

Waxaa jira laba siyaabood oo lagu heli karo faylasha mulkiilaha. Mid waa magaca isticmaalaha mulkiilaha, ka kalena waa kooxda isticmaalaha. Si aad u hesho magaca isticmaale, isticmaal ikhtiyaarka -user , oo uu ku xigo magaca isticmaalaha. Si aad u hesho kooxda isticmaalaha, adeegso -group oo uu raaco magaca kooxda.

Find -user groupname or find -username username(find -user username)

Linux Find Files by Tusaalaha La Bedelay Ugu Dambeeyay(Linux FIND Files by Last Modified Example)

Si aad u hesho faylasha la beddelay, ama la tafatiray, ee tirada X ee ugu dambaysay, isticmaal -mtime oo ay ku xigto lambar. Dhigista calaamadda ( - ) ee lambarka hortiisa waxay heli doontaa wax la beddelay maalmo badan ka hor hadda. Calaamadda lagu daray ( + ) micnaheedu waa maalmo badan oo hadda ka hor. 

find -name “file-sample*” -mtime +5 (greater than 5 days ago)

find -name “file-sample*” -mtime -5 (less than 5 days ago)

Si aad u hesho daqiiqadaha ugu dambeeya ee wax laga beddelay, isticmaal ikhtiyaarka -mmin oo ay ku xigto tirada daqiiqadaha. Isticmaal + iyo - sida kor ku xusan.

find -name “file-sample*” -mmin -5

find -name “file-sample*” -mmin +5

Linux Find Files oo ah Tusaalaha Wakhtiga Ugu Dambeeyey ee La Helay(Linux FIND Files by Last Accessed TIme Example)

Ikhtiyaarka loo isticmaalo in lagu helo faylasha ku salaysan markii ugu dambaysay ee la furay waa -wakhti(-atime ) maalmo ah iyo -amin daqiiqado. Raac tirada maalmaha ama daqiiqadaha si aad dib ugu noqoto oo aad isticmaasho + iyo – saxeex in ka badan iyo ka yar.

find -name “file-sample*” -atime -5

find -name “file-sample* -amin -5

Ku dar FIND iyo amarada Linux kale(Combine FIND with Other Linux Commands)

Waxaa jira hal tusaale oo kor ku xusan oo ah isticmaalka raadinta amarka grep, waxaadna u isticmaali kartaa kuwa kale oo badan. Waxaad arki kartaa in isticmaalka helitaanka iyo amarada kale ay noqon karaan kuwo aad u xoog badan iyo waqti-badiye weyn. Bal qiyaas(Imagine) inaad tirtirto farabadan nooc gaar ah oo fayl ah. Halkii aad ka raadin lahayd agagaarka faylka sahamiyaha, kaliya farsamayso amarka saxda ah, waxaana lagu sameeyaa ilbiriqsiyo gudahood. Sideed hadda u isticmaali doontaa amarka raadinta?



About the author

Anigu waxaan ahay windows 10/11/10 xirfadle taageero macaamiisha leh in ka badan 5 sano oo waayo-aragnimo ah. Waxaan sidoo kale ahaa ciyaaryahan aad u firfircoon dhowrkii sano ee la soo dhaafay waxaanan xiiso xoog leh u hayaa xbox One. Diiradayda hadda waa ka caawinta macaamiisha dhibaatooyinka ay ku qabaan nidaamyada Windows 10 ama Windows 11, marar badan iyada oo la adeegsanayo aaladaha adeegga macaamiisha, sida taageerada xarunta wacitaanka iyo caawinta khadka.



Related posts