Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.21 KB

linux-commands.md

File metadata and controls

48 lines (36 loc) · 1.21 KB

Linux Commands

Finding and Searching

  • Find a Pravega Java process (while avoiding seeing a wall of text shown on ps -ef | grep java):

    pgrep -f logback.configurationFile
    

VI and VIM

VIM:

  • Copying file contents
    • Yank the whole file:
      $ ggVGy
      
      # Or alternatively: 
      $ gg"*yG
      # gg - gets the cursor to the first character
      # "*y - Start the yank command to the register * from the first line
      # G - end of the file

Shell Scripts and Environment

Further Reading:

Miscellaneous

  • Show IP addresses: ip addr show
  • Avoid having to type sudo <command>: sudo -s
  • Disk space usage of a directory https://www.ostechnix.com/find-size-directory-linux/
  • Remove all directories with name build: find -path "*/build/*" -delete
  • Disk usage:
    $ du -sh * 
    $ du -sh <dir>
    

Links