Artur Krzywanski

One liners

My collection of one liners, commands, hacks that make my life easier (just to not forget them):

Renaming files

Rename from one extension to another:

user@computer:$ rename 's/\.err$/\.dat/' *.err

Remove extension:

user@computer:$ rename 's/\.err$//' *.err

Replacing strings

Replace Me with You

user@computer:$ sed -i 's/Me/You/g' file_name

Other

Show listening ports:

user@computer:$ netstat -an | grep LISTEN

Edit two files in diff mode:

user@computer:$ vimdiff file_name

Remove comments and empty lines with grep:

user@computer:$ grep -v -e ^# -e ^$ file.txt

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...