ls ( -g option )

UNIX Command

$ls -g
total 4
-rw-r--r-- 1 jeffrin 0 Feb 19 22:30 a1.txt
-rw-r--r-- 1 jeffrin 2 Feb 19 22:31 a2.txt
$

UNIX Explanation

 -g     like -l, but do not list owner

computer science related Theory Drop

Every  file  or   folder  in  UNIX  has  access
permissions.   There   are   three   types   of
permissions (what allowed to do with a file):

read access
write access
execute access
Permissions are defined for three types of users:

the owner of the file
the group that the owner belongs to
other users


source : http://www.zzee.com/solutions/unix-permissions.shtml

How to list numeric user and group IDs ?

UNIX Command

$ls a1.txt a2.txt $ls -n total 4 -rw-r--r-- 1 1000 1000 0 Feb 19 22:30 a1.txt -rw-r--r-- 1 1000 1000 2 Feb 19 22:31 a2.txt $id a1.txt id: a1.txt: No such user $id jeffrin uid=1000(jeffrin) gid=1000(jeffrin) groups=1000(jeffrin),29(audio),33(www-data),1001(wireshark),119(mysql) $

Unix Explanation

-n, --numeric-uid-gid like -l, but list numeric user and group IDs

Theory Drop

Unix-like operating systems identify users within the kernel by an unsigned integer value called a user identifier, often abbreviated to UID or User ID. The range of UID values varies amongst different systems; at the very least, a UID represents a 15-bit integer, ranging between 0 and 32767, with the following restrictions: The superuser must always have a UID of zero (0). The user "nobody" traditionally got the largest possible UID (as the opposite of the superuser): 32767. More recently, systems have assigned the user a UID in the system range (1-100, see below) or in the range 100530-100535. Convention reserves UIDs from 1 to 100 for system use; some manuals recommend reserving UIDs from 101 up to 499 (Red Hat Enterprise Linux) or even up to 999 (Debian) as well. source : http://en.wikipedia.org/wiki/User_identifier

Hacking with ls options ( -S -1 -r)

GNU Command

$> a1.txt
$a > a2.txt
bash: a: command not found
$echo a > a2.txt
$ls -S
a2.txt	a1.txt
$ls -S -1
a2.txt
a1.txt
$ls -r -S -1
a1.txt
a2.txt
$

UNIX Explanation


 -S     sort by file size
-1     list one file per line
-r, --reverse
              reverse order while sorting


computer science Theory Drop

Sorting is any  process of arranging items in  some sequence and/or
in different sets, and accordingly, it has two common, yet distinct
meanings:  ordering:  arranging  items  of the  same  kind,  class,
nature, etc.  in some ordered sequence,  categorizing: grouping and
labeling items with similar properties together (by sorts).

source : http://en.wikipedia.org/wiki/Sorting

stat Perl API

Perl API — stat()

$ls test.pl
test.pl
$cat test.pl
my $result = stat('./test.pl');
print "$result n";
$perl test.pl
1
$

Perl Explanation

Returns a 13-element list giving the status info for a file, either
the file opened  via FILEHANDLE or DIRHANDLE, or  named by EXPR. If
EXPR is omitted,  it stats $_ (not _ !). Returns  the empty list if
stat fails.

computing Theory Drop
stat() is a Unix system call  that returns useful data about a file
inode. The  semantics of stat() vary between  operating systems. As
an example, the Unix command  ls uses it to retrieve information on
(among many others):

source : http://en.wikipedia.org/wiki/Stat_(system_call)

encode_json Function

Perl API

$json_text = encode_json $perl_scalar

Perl Explanation

Converts the given  Perl data structure to a  UTF-8 encoded, binary
string

computer science Theory Drop

Scalar  processors   represent  the  simplest   class  of  computer
processors.  A  scalar processor  processes  one  datum  at a  time
(typical data items being integers or floating point numbers).[1] ,
a  scalar  processor is  classified  as  a  SISD processor  (Single
Instructions, Single Data).  In  a vector processor, by contrast, a
single  instruction   operates  simultaneously  on   multiple  data
items. The difference is analogous to the difference between scalar
and vector arithmetic.


source :http://en.wikipedia.org/wiki/Scalar_processor

Value Addition Theory

Collections From Various Sources

  1. Science being used to stand for knowledge, and “art” for the
    application of knowledge.
  2. Several sciences are often necessary to form the ground work of a
    single art.
  3. Science is knowledge which we understand so well that we can teach
    it to a computer;and if we do not fully understand something, it is
    an art to deal with it.
  4. The process of going from an art to a science means that we learn
    how to automate something

  5. We should continually be striving to transform every art into a
    science:in the process,we advance the art

<!–

–>

<!–

–>
<!– http://www.beautifulwork.org/Js/foo.js –>

tasksel – a user interface for installing tasks

Debian Command

$tasksel --list-tasks
u desktop	Debian desktop environment
u web-server	Web server
u print-server	Print server
u database-server	SQL database
u dns-server	DNS Server
u file-server	File server
u mail-server	Mail server
u ssh-server	SSH server
u laptop	Laptop
u manual	manual package selection
$tasksel --task-packages
Option task-packages requires an argument
Usage:
tasksel install 
tasksel remove 
tasksel [options]
	-t, --test          test mode; don't really do anything
	    --new-install   automatically install some tasks
	    --list-tasks    list tasks that would be displayed and exit
	    --task-packages list available packages in a task
	    --task-desc     returns the description of a task
$tasksel --task-packages ssh-server
task-ssh-server
$

Debian Explanation

tasksel shows all available tasks and allows to user to select ones
to install

computer science Theory Drop

A  task is  an execution  path through  address space.[1]  In other
words, a set of program instructions that are loaded in memory. The
address registers have been loaded  with the initial address of the
program. At the next clock  cycle, the CPU will start execution, in
accord with the program. The sense  is that some part of 'a plan is
being accomplished'. As long as the program remains in this part of
the   address  space,   the  task   can  continue,   in  principle,
indefinitely, unless the program instructions contain a halt, exit,
or return.

source : http://en.wikipedia.org/wiki/Task_(computing)

Books

Books Currently Reading
  1. Linux Programming Interface | No Starch Press .
  2. Computer Architecture | Nicholas P. Carter .
  3. Discrete Mathematics | Seymour Lipschutz, Marc Lipson
  4. Calculus Workbook FOR Dummies | Mark Ryan
  5. Pre-Algebra Essentials for DUMMIES | Mark Zegarelli

stat – display file or file system status

UNIX Command

$stat /usr/sbin/famd
  File: `/usr/sbin/famd'
  Size: 147504    	Blocks: 304        IO Block: 4096   regular file
Device: 801h/2049d	Inode: 7572257     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-01-24 00:00:54.000000000 +0530
Modify: 2010-08-03 15:32:44.000000000 +0530
Change: 2012-01-24 00:00:07.000000000 +0530
 Birth: -
$

UNIX Explanation

 Display file or file system status.