1 # mhom.de started! [March the 3rd, 2014]

 2 This page is a collection of some useful bash commands. All commands had been tested.

 3 If you have any remarks or a command that should be added contact me: lattes 2000 at hotmail dot com

 4

 5 # Save a file with vim without permission [March the 5th, 2014]

 6 :w !sudo tee %

 7

 8 # Edit a file remotely via scp [March the 5th, 2014]

 9 vim scp://@host//path/to/file

10

11 # list files that contains any string [March the 5th, 2014]

12 find . -type f -exec grep -qi "text" {} \; -print

13

14 # Delete commented lines with vim (complete line with '#')[March the 9th, 2014]

15 :g/\#/d

16

17 # Turn on / off nonprintable character with vim [March the 9th, 2014]

18 :set list / :set nolist

19

20 # alternative to 'diff' [March the 9th, 2014]

21 vim -d <file1> <file2> <fileN>

22

23 # see when your linux was installed [March the 27th, 2014]

24 mount | grep /boot | cut -f 1 -d " " | xargs -i tune2fs -l {} | grep cr

25

26 # print output from a command every 0.1 sec [May the 30th, 2014]

27 watch -n 0.1 <cmd>

28

29 # login as user which has shell /bin/false [December the 26th, 2014]

30 su - <user> -s /bin/bash

31

32 # Display CPU cores [February the 3rd, 2015]

33 grep 'model name' /proc/cpuinfo | wc -l

34

35 # Display and sort files larger than 50 Megabytes (thx to mediamill.de) [March the 2nd, 2016]

36 find / -type f -size +50000k | xargs ls -lahS

37