Thaum ua haujlwm hauv txhua qhov kev khiav hauj lwm, qee zaus yuav tsum siv cov cuab yeej los nrhiav cov ntaub ntawv. Qhov no kuj tseem ceeb rau Linux, yog li hauv qab no yuav suav tau tias yog txhua txoj hau kev los nrhiav cov ntaub ntawv hauv OS no. Ob tus neeg tswj cov ntaub ntawv cov cuab yeej thiab cov lus txib siv "Terminal".
Saib kuj:
Rename cov ntaub ntawv hauv Linux
Tsim thiab rho tawm cov ntaub ntawv hauv Linux
Terminal
Yog tias koj xav tau ntau yam kev nrhiav tsis pom cov ntaub ntawv kom zoo, qhov kev hais kom ua nrhiav tau indispensable. Ua ntej yuav xam tag nrho nws cov kev hloov, nws yog tsim nyog mus dhau ntawm cov syntax thiab kev xaiv. Nws muaj cov nram qab no syntax:
nrhiav kab kev xaiv
qhov twg txoj kev - qhov no yog qhov directory uas tshawb nrhiav. Nws muaj peb qho kev xaiv tseem ceeb ntawm kev qhia meej txog txoj hauv kev:
- / - tshawb nrhiav los ntawm cov hauv paus thiab nyob ib sab;
- ~ - tshawb hauv tsev directory;
- ./ - tshawb hauv cov directory uas tus neeg siv tam sim no nyob rau hauv.
Koj tuaj yeem hais qhia txoj kab ncaj nraim mus rau qhov chaw uas cov ntaub ntawv yuav tsum tau nyob.
Kev xaiv nrhiav tau ntau heev, thiab nws yog tsaug rau lawv tias koj tuaj yeem ua tau lub chaw yooj yim nrhiav teeb los ntawm qhov tsim nyog hloov zog:
- -name - ua ib qho kev tshawb nrhiav, raws li lub npe ntawm cov khoom yuav raug tshawb rau;
- -user - nrhiav cov ntaub ntawv uas muaj rau ib tus neeg siv;
- -group - tshawb nrhiav ib pawg neeg ntawm cov neeg siv;
- -txaas - Qhia cov ntaub ntawv nrog cov qauv siv tau;
- -txoj n - tshawb, raws qhov loj ntawm qhov khoom;
- -mtime + n -n - nrhiav cov ntaub ntawv uas tau hloov ntau dua (+ n) los yog tsawg dua (-na) hnub dhau los;
- - hom - tshawb rau cov ntaub ntawv ntawm ib hom twg.
Muaj ntau ntau hom kev xav tau heev. Ntawm no yog cov npe ntawm lawv:
- b - thaiv;
- f - qub;
- p - lub npe hu ua;
- d - catalog;
- l - txuas;
- s - qhov ntsaws;
- c - tus cwj pwm.
Tom qab cov ncauj lus kom ntxaws syntax parsing thiab cov kev xaiv nrhiav tau Koj tuaj yeem ncaj qha mus rau cov qauv piv txwv. Vim yog kev nplua nuj ntawm txoj kev siv cov lus txib, piv txwv yuav tsis raug rau tag nrho cov qhob, tab sis tsuas yog siv rau feem ntau.
Saib kuj: Nrov kev cai nyob rau hauv "Terminal" Linux
Txoj kev 1: Nrhiav raws npe (xaiv-lub npe)
Feem ntau, cov neeg siv qhov kev xaiv los nrhiav qhov system. -nameyog li cia peb pib nrog nws. Cia peb kuaj ob peb yam piv txwv.
Tshawb nrhiav los ntawm kev ncua
Xav tias koj yuav tsum nrhiav cov ntaub ntawv nrog qhov kev txuas ntxiv rau hauv lub system ".xlsx"uas yog nyob hauv phau ntawv teev npe Dropbox. Ua li no, siv cov lus txib nram qab no:
nrhiav / tsev / neeg / neeg / Dropbox -name "* .xlsx" -print
Los ntawm nws cov syntax, peb tuaj yeem hais tias tshawb nrhiav nyob hauv phau ntawv teev npe Dropbox ("/ tsev / neeg / Dropbox"), thiab qhov khoom xav tau yuav tsum ua nrog qhov kev txuas ntxiv ".xlsx". Lub asterisk qhia tias kev tshawb nrhiav yuav raug ua tiav rau txhua cov ntaub ntawv ntawm qhov kev txuas ntxiv no, tsis suav los ntawm lawv lub npe. "-tej" qhia tias kev tshawb nrhiav pom yuav raug muab tso tawm.
Piv txwv:
Nrhiav los ntawm cov ntaub ntawv lub npe
Piv txwv, koj xav nrhiav hauv phau ntawv qhia "/ tsev" cov ntaub ntawv muaj npe "lumpics"tab sis nws txoj kev txuas ntxiv tsis paub. Hauv qhov no, ua cov hauv qab no:
nrhiav ~ -name "lumpics *" -print
Raws li koj tau pom, lub cim yog siv ntawm no. "~", uas txhais tau hais tias kev tshawb nrhiav yuav tsum muaj nyob rau hauv cov directory hauv tsev. Tom qab xaiv "npe" Lub npe ntawm cov ntaub ntawv koj tab tom nrhiav ("lumpics *"). Ib lub hnub qub nyob rau ntawm qhov kawg txhais tau hais tias qhov kev tshawb no yuav tshwm sim tsuas yog npe xwb, tsis suav nrog kev txuas ntxiv.
Piv txwv:
Nrhiav thawj tsab ntawv npe
Yog tias koj nco qab tsuas yog thawj tsab ntawv uas lub npe hu ua, nws muaj lus txib tshwjxeeb uas yuav pab koj nrhiav tau. Piv txwv li, koj xav nrhiav cov ntaub ntawv uas pib ntawm tsab ntawv tuaj "g" mus txog "L"thiab koj tsis paub nyob rau hauv phau ntawv qhia twg nws nyob. Tom qab ntawd koj yuav tsum khiav cov lus txib nram qab no:
nrhiav / -name "[g-l] *" -print
Txiav txim los ntawm lub cim "/" uas tuaj sai tom qab lo lus tseem ceeb, kev tshawb nrhiav yuav pib ua ntej pib ntawm cov hauv paus hauv paus, uas yog, nyob rau hauv tag nrho lub cev. Ntxiv, ib feem "[g-l] *" txhais tau hais tias lo lus tshawb nrhiav yuav pib nrog ib tsab ntawv tshwj xeeb. Nyob rau hauv peb cov ntaub ntawv los ntawm "g" mus txog "L".
Los ntawm txoj kev, yog tias koj paub cov ntaub ntawv ntxiv, ces tom qab lub cim "*" yuav qhia nws. Piv txwv li, koj yuav tsum nrhiav tib cov ntaub ntawv, tab sis koj paub tias nws muaj kev txuas ntxiv ".odt". Tom qab ntawd koj tuaj yeem siv cov lus txib nram qab no:
nrhiav / -name "[g-l] * ib nrab
Piv txwv:
Txoj kev 2: Nrhiav tau los ntawm kev siv hom (xaiv -perm)
Qee lub sij hawm nws yog qhov yuav tsum tau nrhiav ib yam khoom uas koj lub npe tsis paub, tab sis koj paub tias nws muaj hom ntawv dab tsi. Tom qab ntawd koj yuav tsum tau siv qhov kev xaiv "-perm".
Nws yog qhov yooj yim heev rau siv, koj tsuas yog yuav tsum qhia kom meej qhov chaw nrhiav thiab nkag mus. Ntawm no yog ib qho piv txwv ntawm xws li ib lo lus txib:
nrhiav tau ~ -perm 775 -print
Ntawd yog, kev tshawb nrhiav nyob hauv tsev, thiab cov khoom uas koj tab tom nrhiav yuav muaj kev nkag. 775. Koj kuj tuaj yeem sau ntawv cim "-" nyob rau hauv pem hauv ntej ntawm tus xovtooj no, tom qab ntawd cov khoom uas pom muaj yuav raug tso cai ntawm xoom rau qhov nqi.
Txoj kev 3: Nrhiav los ntawm tus neeg siv los sis pawg (-user thiab-pab pawg xaiv)
Hauv txhua qhov kev khiav hauj lwm muaj cov neeg siv thiab pawg. Yog tias koj xav nrhiav ib qho khoom uas yog ib qho ntawm cov pawg, ces qhov no koj tuaj yeem siv qhov kev xaiv "-user" los yog "pab pawg", ntsig txog.
Nrhiav ib daim ntawv los ntawm nws lub npe
Piv txwv li, koj yuav tsum nrhiav hauv phau ntawv teev npe Dropbox cov ntaub ntawv "Lampics", tab sis koj tsis paub dab tsi nws yog hu ua, thiab koj tsuas paub tias nws belongs rau tus neeg siv "neeg siv". Tom qab ntawd koj yuav tsum khiav cov lus txib nram qab no:
nrhiav / tsev / neeg / neeg / Dropbox -user neeg -print
Hauv tsab ntawv no koj teev tias qhov tsim nyog directory (/ tsev / neeg / Dropbox), qhia tias koj yuav tsum tau tshawb rau cov ntaub ntawv muaj los ntawm tus neeg siv (-user), thiab qhia tias tus neeg siv cov ntaub ntawv no yog leej twg (tus neeg siv).
Piv txwv:
Saib kuj:
Yuav ua li cas mus saib ib daim ntawv teev cov neeg siv hauv Linux
Yuav ua li cas ntxiv ib tus neeg siv rau ib pawg hauv Linux
Nrhiav ib daim ntawv los ntawm nws lub npe pawg
Tshawb nrhiav rau cov ntaub ntawv uas belongs rau ib pawg tshwj xeeb yog ib qho yooj yim heev - koj tsuas xav hloov qhov kev xaiv. "-user" ntawm kev xaiv "pab pawg" thiab qhia lub npe ntawm pawg neeg no:
nrhiav / nrub-qhua qhua -print
Ntawd yog, koj tau sau hais tias koj xav nrhiav cov ntaub ntawv no rau cov pab pawg hauv lub cev "qhua". Tshawb nrhiav yuav tshwm sim thoob plaws hauv lub cev, qhov no yog qhia los ntawm lub cim "/".
Method 4: Nrhiav ib daim ntawv los ntawm nws cov hom (xaiv qhov xaiv)
Nrhiav qee lub caij hauv ib hom ntawm Linux yog qhov yooj yim heev, koj tsuas yog yuav tsum qhia meej txog qhov kev xaiv (- hom) thiab kos tus cim hom. Thaum pib ntawm tsab xov xwm tau teev muaj tag nrho cov qauv kev xaiv uas tuaj yeem siv rau kev tshawb nrhiav.
Piv txwv li, koj xav nrhiav cov ntaub ntawv thaiv hauv koj lub tsev directory. Hauv qhov no, koj pab neeg yuav zoo li no:
nrhiav ~ ~ hom b -print
Raws li, koj tau hais tias koj tab tom tshawb nrhiav ntawm hom ntaub ntawv, raws li qhia los ntawm qhov kev xaiv "hom", thiab tom qab ntawd txiav txim siab nws hom los ntawm muab cov ntaub ntawv thaiv cov cim - "b".
Piv txwv:
Ib yam li ntawd, koj tuaj yeem tso saib tagnrho cov kev qhia hauv cov qauv kev xav los ntawm kev sau hauv kev hais kom ua "d":
nrhiav / tsev / neeg / neeg-ntaus d-ntawv
Txoj kev 5: Nrhiav ib daim ntawv los ntawm qhov loj (qhov xaiv-xaiv)
Yog tias los ntawm tag nrho cov ntaub ntawv hais txog cov ntaub ntawv koj paub tsuas yog nws loj, ces txawm qhov no yuav txaus los nrhiav nws. Piv txwv, koj xav nrhiav cov ntaub ntawv ntawm 120 MB hauv ib phau ntawv qhia tshwj xeeb los ntawm kev ua cov hauv qab no:
nrhiav / tsev / neeg / neeg / Dropbox -tsize 120M -print
Piv txwv:
Saib kuj: Yuav ua li cas paub qhov loj ntawm ib nplaub tshev hauv Linux
Raws li koj tuaj yeem pom, cov ntaub ntawv peb xav tau raug pom. Tab sis yog tias koj tsis paub nyob rau hauv phau ntawv teev npe uas nws nyob rau hauv, koj tuaj yeem tshawb tag nrho lub hauv paus los ntawm kev qhia tawm cov hauv paus hauv paus ntawm qhov pib ntawm qhov hais kom ua:
nrhiav / -size 120M -print
Piv txwv:
Yog tias koj paub cov ntaub ntawv loj npaum li cas, tom qab ntawd ces qhov no muaj qhov tshwj xeeb hais kom ua. Koj yuav tsum sau npe rau hauv "Terminal" qhov qub, ua ntej specifying cov ntaub ntawv loj muab tso rau ib qho "-" (yog tias koj xav nrhiav cov ntaub ntawv me tshaj qhov tau teev tseg) lossis "+" (yog tias qhov loj ntawm cov ntaub ntawv yuav tsum tau loj tshaj qhov tau teev tseg). Ntawm no yog ib qho piv txwv ntawm xws li ib lo lus txib:
nrhiav / tsev / neeg / neeg / Dropbox + 100M -print
Piv txwv:
Txoj kev 6: Nrhiav cov ntaub ntawv los ntawm kev hloov hnub (xaiv -mtime)
Muaj qee zaum thaum nws yog qhov yooj yim tshaj plaws los mus tshawb rau cov ntaub ntawv raws hnub nws tau hloov kho. Ntawm Linux, qhov kev xaiv yog siv. "-mtime". Nws yog qhov yooj yim heev rau siv nws, peb yuav xav txog txhua yam ntawm ib qho piv txwv.
Cia peb hais hauv daim nplaub tshev "Cov duab" peb yuav tsum nrhiav cov khoom uas tau hloov rau 15 hnub dhau los. Nov yog yam koj yuav tsum sau npe rau "Terminal":
nrhiav / tsev / neeg / duab / dluab -mtime -15 -print
Piv txwv:
Raws li koj tau pom, qhov kev xaiv no tsis yog qhia cov ntaub ntawv xwb uas tau hloov dhau ib lub sijhawm, tab sis kuj muaj cov ntawv sau. Nws ua haujlwm hauv kev coj - koj tuaj yeem nrhiav cov khoom uas tau hloov tom qab lub sijhawm teev tseg. Ua li no, sau ib daim ntawv ua ntej cov nqi digital. "+":
nrhiav / tsev / neeg / duab / dluab -mtime +10 -print
GUI
Cov graphical interface pab tswj lub neej ntawm cov neeg tuaj tshiab uas tau cia li thauj Linux. Qhov kev tshawb nrhiav no zoo sib xws rau ib lub hauv lub Windows OS, tab sis nws tsis tuaj yeem muab txhua qhov zoo rau nws. "Terminal". Tiam sis thawj yam ua ntej. Yog li, cia saib seb yuav ua li cas ua ib qho kev tshawb nrhiav hauv Linux siv lub kaw lus graphical interface.
Txoj kev cai 1: Nrhiav ntawm qhov system tshuab raj
Tam sim no peb yuav xav txog txoj kev mus tshawb rau cov ntaub ntawv los ntawm cov zaub mov ntawm lub Linux system. Cov kev ua ub no yuav tsum tau ua hauv Ubuntu 16.04 LTS faib, tab sis, qhov kev qhia no yog rau txhua tus.
Saib kuj: Yuav ua li cas thiaj paub qhov version ntawm Linux faib
Xav tias koj yuav tsum nrhiav cov ntaub ntawv hauv lub tshuab raws li lub npe "Nrhiav kuv"Nws kuj muaj ob qho ntaub ntawv hauv qhov system: ib qho ntawm hom ntawv ".txt"thiab qhov thib ob ".odt". Yuav nrhiav tau lawv, koj yuav tsum tau chiv nias rau ntawv qhia zaub mov icon (1)thiab hauv kev tshwj xeeb tawm tswv yim dab tsi (2) thov kom muaj lus nug "Nrhiav kuv".
Ib qho kev tshawb nrhiav pom tshwm, uas qhia cov ntaub ntawv koj tab tom nrhiav.
Tab sis yog tias muaj ntau cov ntaub ntawv hauv lub cev thiab txhua tus ntawm lawv muaj kev txuas ntxiv, qhov kev tshawb no yuav nyuaj dua. Yuav kom tshem tawm cov ntaub ntawv tsis tseem ceeb, piv txwv li, cov kev pabcuam, hauv cov qhabnias tawm, nws yog qhov zoo tshaj rau koj siv lub lim.
Nws nyob rau sab xis ntawm lub tshuab raj. Koj tuaj yeem lim los ntawm ob txoj cai: "Pawg" thiab "Cov chaw". Nthuav qhia ob lub npe no los ntawm txhaj rau sab xub ntiag rau lub npe, thiab hauv cov ntawv qhia, tshem tawm cov kev xaiv ntawm cov khoom tsis ruaj. Nyob rau hauv cov ntaub ntawv no, nws yuav ntse mus tawm tsuas yog ib tug tshawb los ntawm "Cov ntaub ntawv thiab cov folders", vim peb tab tom nrhiav raws nraim cov ntaub ntawv.
Koj tuaj yeem pom sai rau qhov tsis muaj hom no - koj tsis tuaj yeem kho qhov lim hauv kev nthuav dav, raws li nyob rau hauv "Terminal". Yog li, yog tias koj tab tom nrhiav cov ntawv nyeem nrog ib lub npe, koj tuaj yeem pom cov duab, cov ntawv sau, cov ntaub ntawv, thiab lwm yam ntxiv rau hauv cov ntaub ntawv.Tab sis yog tias koj paub lub npe lub npe ntawm cov ntaub ntawv koj xav tau, koj tuaj yeem nrhiav nws yam tsis paub txog ntau txoj kev txib "nrhiav".
Txoj kev 2: Nrhiav los ntawm tus thawj tswj xyuas cov ntaub ntawv
Txoj kev thib ob muaj qhov muaj txiaj ntsig zoo dua. Siv cov ntaub ntawv tus neeg tswj xyuas lub cuab tam, koj tuaj yeem tshawb nrhiav hauv phau teev npe.
Ua tau cov haujlwm no yooj yim. Koj yuav tsum nyob rau hauv cov ntaub ntawv tus thawj tswj, nyob rau hauv peb cov ntaub ntawv Nautilus, nkag mus rau lub nplaub tshev nyob qhov twg cov ntaub ntawv koj tab tom nrhiav yog yuav tsum, thiab nyem "Tshawb nrhiav"nyob rau hauv sab qaum txoj cai ntawm lub qhov rais.
Nyob rau hauv lub tswv yim tawm tswv yim koj yuav tsum nkag mus rau qhov kwv yees cov ntaub ntawv. Tsis tas li ntawd tsis txhob hnov qab tias kev tshawb nrhiav ua tsis tau los ntawm tag nrho cov ntaub ntawv lub npe, tab sis tsuas yog los ntawm nws qhov, raws li qhia hauv tus qauv hauv qab no.
Raws li nyob rau hauv txoj kev dhau los, qhov no koj tuaj yeem siv lub lim. Qhib nws, nias ntawm lub pob nrog qhov kos npe "+"nyob rau hauv txoj cai ib feem ntawm kev tshawb nrhiav cov lus nug teb. Ib tug submenu yuav qhib qhov twg koj tuaj yeem xaiv qhov yam ntaub ntawv xa tawm ntawm daim ntawv teev npe cia.
Xaus
Ntawm qhov foregoing, nws muaj peev xwm yuav xaus lus tias qhov thib ob hom, khi rau kev siv lub graphical interface, yog zoo meej rau kev tshawb nrhiav ceev los ntawm lub system. Yog hais tias koj yuav tsum tau teev ntau ntawm kev nrhiav, ces qhov kev txiav txim yuav tsis txaus nrhiav tau hauv "Terminal".