-
This article show how you can obtain the UNIX epoch time (number of seconds since 1970-01-01 00:00:00 UTC) using the Linux bash “date” command. It also shows how you can convert a UNIX epoch time to a human readable time. Obtain UNIX epoch time using bash Obtaining the UNIX epoch time using bash is easy. Use the …
Read More -
The purpose of this small message is to show how you can configure a static IP address in Debian Linux. I know that other sites have more detailed explanations on this (and the man page too), but I put it here mostly as a reminder to myself. Add the following content in /etc/networking/interfaces to configure a static …
Read More -
An example of how you can concatenate lines from an input file using the sed command line tool. Suppose you have the following file: AA 123 BB 456 CC 789 And you want to transform it into the following: AA; 123 BB; 456 CC; 789 This can easily be achieved by using the Linux command sed. However, putting all …
Read More -
How to find SGID files. There are 2 ways to find SGID files:
You can directly search for them using the find command \ You can take a complete listing of the file system, and searching through that listing afterwards \ The advantage of using the find command is that you directly have the information you need. …
Read More -
How to find SUID files. There are 2 ways to find SUID files:
You can directly search for them using the find command \ You can take a complete listing of the file system, and searching through that listing afterwards \ The advantage of using the find command is that you directly have the information you need. …
Read More -
Some more advanced examples of how to use the sed command in Linux. Add a character to the beginning of a line (e.g. the | character): sed -e 's/^/|/' orig.txt > new.txt Change a file from Unix to Windows format (i.e. add a \r at the end of the line): sed -e 's/$/\r/' myunix.txt > mydos.txt Change a file from Windows …
Read More -
Some of the character classes to use in regular expressions. alpha Any letter, [A-Za-z] upper Any uppercase letter, [A-Z] lower Any lowercase letter, [a-z] digit Any digit, [0-9] alnum Any alphanumeric character, [A-Za-z0-9] xdigit Any hexadecimal digit, [0-9A-Fa-f] space A tab, new line, vertical tab, form feed, …
Read More -
How to burn CD’s using only bash. First create an iso with the following command: mkisofs -o HomeMovie.iso -J -r -V HomeMovie Movie.avi Movie.srt In this example:
-o names the new .iso image file (HomeMovie.iso) \ -J uses Joliet naming records, for Windows compatibility \ -r uses Rock Ridge naming conventions for …
Read More