Fd, madadin umarnin nema, mai sauƙi, mai sauri da sauƙi don amfani

game da FD

A talifi na gaba zamuyi nazari akan fd. Wannan kayan aiki ne mai sauri, mai sauƙi, da sauƙi don amfani sa bincike ya zama sauki, idan aka kwatanta da neman umarni. Ba a tsara shi azaman cikakken maye gurbin umarnin nema ba, ana nufin kawai don samar da madaidaiciyar amfani da ke aiki da sauri kaɗan.

A yau yawancin masu amfani da Gnu / Linux sun saba da umarnin nema da kuma lokuta da yawa inda zai iya zama mai amfani. A cikin layuka masu zuwa zamuyi la'akari da shigarwa da amfani mai yiwuwa fd don samun damar bincika cikin fayilolinmu.

Janar halaye fd

Wasu daga cikin sanannun sifofi sune:

  • Una sauki don amfani da kalmomin aiki. Dole ne kawai ku rubuta tsarin fd **.
  • Yayi a launuka masu launi, kwatankwacin umarnin ls.
  • Za mu sami sauri amsa.
  • Yana sa a bincike mai wayo, tare da manyan haruffa da loweraramin rubutu ta tsohuwa.
  • Baya bincika ɓoyayyun fayiloli da kundayen adireshi ta tsohuwa

Waɗannan su ne kawai wasu daga cikin fasali. Duk ana iya neman su daga Aikin GitHub na aikin.

Sanya fd akan Ubuntu

Don girka wannan aikace-aikacen binciken a cikin Ubuntu da tushen tushen Debian dole ne muyi zazzage sabon salo daga shafin gabatarwa. Hakanan zamu iya amfani da tashar (Ctrl + Alt T) zuwa zazzage .deb kunshin ta amfani da wget. Don wannan muna rubuta:

Zazzage fd tare da wget

wget https://github.com/sharkdp/fd/releases/download/v7.3.0/fd-musl_7.3.0_amd64.deb

Da zarar an gama saukarwa, za mu iya shigar da kunshin bugawa a cikin wannan tashar:

shigarwar umarnin fd

sudo dpkg -i fd-musl_7.3.0_amd64.deb

Amfani da fd a Ubuntu

Da yake kama da sami umarni, wannan umarnin yana da halaye masu amfani da yawa. Kafin muyi zurfi, yana da kyau mu duba da zaɓuɓɓukan da ake da su. Saboda wannan zamu iya neman taimakonsa ta hanyar bugawa a cikin tashar (Ctrl + Alt + T):

taimaka umarni na fd

fd -h

Misalan amfani da fd

Ga misalai masu zuwa, zan yi amfani da shigar da wani aikin da ake kira abin mamaki located in / ficewa / lampp / htdocs / don yin bincike.

Da farko, zamu iya gudanar da umarnin ba tare da wata hujja ba, fitowar da zamu gani zata kasance kwatankwacin umarnin ls-R:

umarnin fd ba tare da jayayya ba

fd

Za mu iya duba kawai sakamakon 10 na farko, don ganin gajeren fitarwa daga umarnin, ta hanyar bugawa:

shugaban fd, iyakance sakamakon zuwa 10

fd | head

Bincika ta kari

Idan muna sha'awar neman duk fayiloli jpg, zamu iya amfani da zaɓi '-e' don tace ta ƙari:

fd tace ta fadada

fd -e jpg

Bincika ta amfani da tsari

La zaɓi '-e' za a iya amfani da shi ma a hade tare da tsari kamar wadannan:

fd tace da tsari

fd -e php index

Wannan umarnin zai bincika fayiloli tare da tsawo php cewa suna da sunan su kirtani 'index'.

Banda shugabanci daga bincike

Idan muna so ware wasu sakamako, za mu iya amfani da zaɓi "-E" mai bi:

tace ta hanyar tsarin kaucewa kundin adireshi

fd -e php index -E PASTE

Wannan umarnin zai bincika duk fayiloli tare da tsawo php, dauke da kirtani 'index'kuma zai cire sakamako daga kundin adireshi'FASAHA'.

Binciko a cikin kundin adireshi

Idan kanaso kayi bincike a cikin takamaiman kundin adireshi, lallai zaka samu nuna shi azaman hujja:

fd bincika fayiloli a cikin kundin adireshi

fd png ./IMG/

Tare da umarnin da ya gabata zamu nemi fayilolin png a cikin kundin IMG.

Yi umarni akan sakamakon da aka samo

Kamar yadda yake tare da nema, zamu iya amfani da -x or -exec muhawara don ƙaddamar da aiwatar da umarni a layi daya tare da sakamakon bincike. A cikin misali mai zuwa zamuyi amfani da chmod don canza izini na fayilolin hoto da aka samo.

fd -e jpg -x chmod 644 {}

Umurnin da ke sama zai samo duk fayiloli tare da haɓakar jpg kuma gudanar chmod 644 akan su.

Waɗannan layukan sun kasance taƙaitaccen bitar umarnin fd. Wasu masu amfani na iya samun wannan umarnin cikin sauƙin amfani da sauri fiye da samu. Kamar yadda aka ambata a farkon labarin, wannan umarnin ba'a nufin maye gurbin samu. Abin sani kawai yana nema ne don samar da sauƙin amfani, sauƙin bincike da ingantaccen aiki. Wannan umarnin baya ɗaukar sarari da yawa, yana da sauƙin shigarwa, kuma kayan aiki ne mai kyau don kasancewa a hannu lokacin da zakuyi aiki tare da takamaiman adadin fayiloli.

Don samun cikakken bayani game da wannan umarnin, mai amfani da yake buƙata zai iya samu ƙarin bayani a cikin ma'aji akan GitHub na aikin. Fuente.


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

2 comments, bar naka

Bar tsokaci

Your email address ba za a buga.

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.

  1.   Santiago m

    A matsayina na marubucin labarin buda ido, zai yi kyau idan ka kawo tushen abinda kake ciki. https://www.tecmint.com/fd-alternative-to-find-command/

    1.    Damien Amoedo m

      Kun yi gaskiya. An faɗi ragowar.