What I learned new this week (week 2)
Before beginning with it I should clearify first why am I writing this. Every day we learn something, specially me because I recently started using Linux for fulltime. So I am learning something every day about it. But I find out that I forget most of it because I do not write it down. So I start writing it down. Also I thought that I should share this with everyone. And this is the second week. There might be some information which is new to you. So let’s get started.
Small Disclaimer:- it is not a typical blog post where we deeply discuss about something. Here I will provide only a small brief about lots of thing.
-
In Linux,
WC
command can be used to get lots of information about a text file. Like- word count, lines count, maximum line length etc.wc filename.txt
will display number of lines, words in that file and the size of the file. -
In Linux, the
DU
command in Linux is used to estimate file and directory space usage. Also when using on a directory it will list out all the files in that directory. You can run it with the following syntax:
du filename or path/to/directory
-
In Linux, To print all the non empty lines of a text file we can use
awk
command.awk 'NF' filename
, this command prints only the lines that have non-empty lines. -
In Mathematics, there is a formula called william’s formula which can be used to determine whether or not a number is prime number. The formula for number j is
[(j-1)!+1/j]
. -
In Linux, we can use
printenv
to list down all the environment variables name and their value.
That’s it for this week. Meeting you next week.