Hoppa till innehåll

Lukas Mattsson

Webbutveckling och IT-support

  • Start
  • Projekt
  • Om mig
  • Blogg
  • Kontakt
  • Yoga

Etikettarkiv: Terminal

The ”terminal” is the command line interface on OSX, which allows using the same types of commands as in Linux.

Hitta antal filer i undermappar

Som bekant går det att använda ett kommando i terminalen för att se vad som tar plats: du . | sort -nr > out.txt Men det finns också ett kommando för att se antal filer i alla undermappar, för att se vilka mappar som behöver komprimeras. Det är mer komplext, men funkar lika bra i […]

Publicerat avLukas Mattsson24 januari 2020 kl 15:5128 oktober 2020 kl 15:51Publicerat iMacEtiketter: OSX, shell, Terminal, Unix

Using find with grep to find strings in files

How yogis code

Here is how to find files containing a certain string. This works in any system supporting Unix commands, including OSX. find . -name ’*.xml’ -exec grep ’string to find’ {} \; Sometimes the files have no line breaks, so you just want to see the filename of the matches. Then you need the -l parameter. […]

Publicerat avLukas Mattsson13 november 2019 kl 14:2727 december 2020 kl 12:34Publicerat iKodEtiketter: shell, Snippets, Terminal, Unix

Kolla diskutrymme i Unix eller OSX

Så här kollar ni vilka filer och mappar som väger mest i Linux, OSX eller liknande system: du / | sort -nr > out.txt

Publicerat avLukas Mattsson10 juni 2018 kl 11:0331 augusti 2020 kl 08:55Publicerat iMac, Teknik, TipsEtiketter: Linux, OSX, shell, Terminal