rm (Unix)
rm (a remove rövidítése) egy Unix parancs, melyet állományok törlésére használunk.
Opciók
[szerkesztés]Lássuk a parancs egy pár opcióját:
-r
, ha rekurzívan akarjuk egy könyvtár állományait törölni-i
, ha azt akarjuk, hogy minden egyes törlésnél a beleegyezésünket kérje ("interactive")-f
, ha nem létező állományokat akarunk törölni ("force")-v
, kimutassa hogy mit törölt ki ("verbose")
Ahhoz, hogy ne legyenek véletlen törlések, ajánlatos az rm parancsot "rm -i" opcióval használni. Ha a felhasználó több állományt töröl, akkor érdemes az -f opciót is használni, ami elnyomja a hibát, ha valamelyik fájl nem létezik, vagy nincs rá írásjog.
Az rm parancsot gyakran használják az xargs paranccsal, ha a törlendő állományok listája fájlban van (ez azonban csak akkor működik, ha a fájlok nevében nincs helyköz):
xargs rm < allomanylista
Amikor az rm-ben egy szimbolikus linket használunk, csak a link törlődik, a linkelt állomány nem.
Ha egy könyvtárat akarunk törölni az állományaival együtt, akkor használjuk a következő parancsot:
rm -r
Ez rekurzívan törli az összes állományt.
Unix parancssoros programok és utasítások | |
---|---|
Fájlrendszer | |
Processzek | |
Felhasználói környezet | |
Szövegkezelés | |
Shell programozás | |
Hálózat | |
Keresés | |
Dokumentáció | |
Egyéb |
Text is available under the CC BY-SA 4.0 license; additional terms may apply.
Images, videos and audio are available under their respective licenses.