Tip #210 Calendar with current date
Add the following sed commands to cal to get a calendar with the current date marked:Read more »
Tip #171 Duplicate directory tree
The following command creates in the /usr/project directory, a copy of the current working directory structure:Read more »
Tip #539 Using sed across multiple lines
Sometimes when using sed you find that you need to match across line endings, this can be achieved by getting sed to match the first line and then pulling a second line into the buffer with the N command.For example, if we have a file: Read more »
- TAGS:
- sed
Tip #384 BBC Weather
Go to [http://www.bbc.co.uk/cgi-perl/weather/search/new_search.pl] and search for your location. Copy the link to the 3 day forecast feed, for example [http://feeds.bbc.co.uk/weather/feeds/rss/5day/world/0105.xml]. Then just put that link into the following command to get a quick command line weather forecast.Read more »
Tip #487 Print part of a file
Print the contents of a file from a given regular expression to anotherRead more »
- TAGS:
- sed
Tip #182 MAC address conversion
Convert mac addresses such as 000000abde00 into 00:00:00:ab:de:00awk '{for(i=10;i>=2;i-=2)$0=substr($0,1,i)":"substr($0,i+1);print}' macaddress_list
sed 's/\(..\)/\1:/g;s/:$//' macaddress_list
// sil at infiltrated.net
Read more »
Tip #540 Command examples from shell-fu
The following isn't particularly pretty and should be considered a work in progress, but it's quite fun.Get examples of ways a command can be used direct from shell-fu by adding the following alias:
Read more »
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs