Recursively Deleting
Dec 12

I needed a quick command to delete a specific file or directory that existing in multiple subdirectories. Here is what I came up with.

find . -name “filename” | xargs rm -rf

Note: files can be a filename or directory name. You can use rm with -rf or without

Quick Guide to Nano or Pico text editor
Dec 12

Here are a few tips on how to get around in NANO

To edit a file type: nano filename
*** if you are using one of the legacy Linux servers, it will say NANO Command Not Found. Use PICO instead

  • CTRL-Y – Page Up
  • CTRL-V – Page Down
  • CTRL-W – Where Is (Search)
  • CTRL-K – Cut current line (press multiple times to multiple lines)
  • CTRL-U – Paste lines just cut (if you cut multiple lines it will paste them all)
  • CTRL-C – Word Count / Line Count / Current Position (will be displayed at bottom of page)
  • CTRL-O then ENTER – Save file
  • If no changes have been made, you can exit by hitting CTRL-X
  • If changes have been made, but you DO NOT want to save, hit CTRL-X then N
  • If changes have been made, but you DO WANT to save, hit CTRL-X then Y, then ENTER

Quick Guide to VI text editor
Dec 12

Here are a few tips on how to get around in VI

To edit a file type: vi filename

Basic vi commands

  • i – Change to insert mode (edit mode)
  • CTRL-C – Change to command mode (exit edit mode)
  • :w – Save the file being edited (command mode only)
  • :wq – Save file and Quit (command mode only)
  • :q – Quit (command mode only)
  • :q! – Quit without saving (command mode only)
  • h/j/k/l Navigation keys if your arrows break (command mode only) (Try pressing scroll-lock first to try and make arrows work)

How to find what RPM provides what files
Dec 12

Have you ever tried to find where a specific file came from?  If it was installed from an RPM, there is an easy way.  Just use the following command.

rpm -q --whatprovides /path/to/file

Next Entries »


Switch to our mobile site