Skip to content

Instantly share code, notes, and snippets.

Avatar
🧙‍♂️

Bassem Dghaidi Link-

🧙‍♂️
View GitHub Profile
@Link-
Link- / inputrc
Created Mar 1, 2015
Up/Down history search
View inputrc
# Create ~/.inputrc file and paste
# this in it
"\e[A": history-search-backward
"\e[B": history-search-forward
# Example:
# cd+UP : will return all previous cd commands
# and paramters
@Link-
Link- / Useful Unix
Last active Nov 24, 2017
Unix : Search & Rescue commands
View Useful Unix
-- Find
egrep -Rl <regular expression> <file or files>
-- Find and Replace
grep -l '' ./* | xargs sed -i "" 's/IP4445A/IP445A/'
-- Find and Replace (no RegEx)
-- Add IMO number
grep -l '' ./* | xargs sed -i "" 's|MSC:172:20+++:146::VITNAME|MSC:172:20+++9299551:146::VITNAME|g'
-- Change VVN
@Link-
Link- / gist:5043704
Created Feb 27, 2013
# Linux # Will tarify all folders/files in a directory and create # a separate tar file for each
View gist:5043704
#!/bin/bash
# Will tarify all folders/files in a directory and create
# a separate tar file for each
for f in */; do tar -cvf "${f%/}.tar" "$f"; done