uptime w whoami id hostname apropos whatis

commandline session

$uptime
 20:57:47 up  1:41,  3 users,  load average: 0.64, 0.71, 0.70
$
$w
 20:57:49 up  1:41,  3 users,  load average: 0.64, 0.71, 0.70
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
jeffrin  tty7     :0               19:16    1:41m  3:50   0.04s gdm-session-worker [pam/gdm3-autologin]
jeffrin  pts/0    :0               20:52    1:25   0.08s  0.08s bash
jeffrin  pts/1    :0               20:57    5.00s  0.05s  0.00s w
$
$whoami
jeffrin
$
$id
uid=1000(jeffrin) gid=1000(jeffrin) groups=1000(jeffrin),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),104(scanner),107(bluetooth),109(netdev)
$
$hostname
debian
$
$
$apropos apt-get
apt-get (8)          - APT package handling utility - - command-line interface
$
$whatis apt-get
apt-get (8)          - APT package handling utility - - command-line interface
$

apt-get (8) – APT package handling utility – – command-line interface

commandline session

NO WARRANTY

$sudo apt-get remove cowsay
[sudo] password for jeffrin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cpp-4.7 libdrm-nouveau1a libmpc2 linux-headers-3.11-1-common linux-kbuild-3.11
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  cowsay
0 upgraded, 0 newly installed, 1 to remove and 1061 not upgraded.
After this operation, 91.1 kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 163573 files and directories currently installed.)
Removing cowsay ...
Processing triggers for man-db ...
$sudo apt-get remove --purge cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'cowsay' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  cpp-4.7 libdrm-nouveau1a libmpc2 linux-headers-3.11-1-common linux-kbuild-3.11
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1061 not upgraded.
$sudo apt-get  --purge cowsay
E: Invalid operation cowsay
$sudo apt-get install cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cpp-4.7 libdrm-nouveau1a libmpc2 linux-headers-3.11-1-common linux-kbuild-3.11
Use 'apt-get autoremove' to remove them.
Suggested packages:
  filters
The following NEW packages will be installed:
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 1061 not upgraded.
Need to get 0 B/21.9 kB of archives.
After this operation, 91.1 kB of additional disk space will be used.
Selecting previously unselected package cowsay.
(Reading database ... 163508 files and directories currently installed.)
Unpacking cowsay (from .../cowsay_3.03+dfsg1-4_all.deb) ...

Processing triggers for man-db ...
Setting up cowsay (3.03+dfsg1-4) ...
$sudo apt-get remove --purge cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cpp-4.7 libdrm-nouveau1a libmpc2 linux-headers-3.11-1-common linux-kbuild-3.11
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  cowsay*
0 upgraded, 0 newly installed, 1 to remove and 1061 not upgraded.
After this operation, 91.1 kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 163573 files and directories currently installed.)
Removing cowsay ...
Processing triggers for man-db ...
$

Video Tutorial (NO WARRANTY)

[youtube https://www.youtube.com/watch?v=bveLudaVAqQ?rel=0&w=560&h=315]

Standard Input,Output and Error Related

commandline session

NO WARRANTY
$echo content > file
$cat file
content
$echo content 1> file
$cat file
content
$echo content 2> file
content
$cat file
$
$echo content 0> file
content
$cat file
$echo content 3> file
content
$cat file
$ls /root/
ls: cannot open directory /root/: Permission denied
$ls /root/ 2> file
$cat file
ls: cannot open directory /root/: Permission denied
$ls /root/ 2>> file
$cat file
ls: cannot open directory /root/: Permission denied
ls: cannot open directory /root/: Permission denied


Video Tutorial Related (NO WARRANTY)

[youtube https://www.youtube.com/watch?v=shFMEJJ_fpU?rel=0&w=560&h=315]

-mtime n File’s data was last modified n*24 hours ago

commandline session

$find . -mtime +1000000
$find . -mtime +100000
$find . -mtime +10000
$find . -mtime +1000
./wallphotos-old
./wallphotos-old/8002_1600x1200-wallpaper-cb1267712759.jpg
./wallphotos-old/18738_1600x1200-wallpaper-cb1271712460.jpg
./wallphotos-old/3767_1600x1200-wallpaper-cb1267712187 (1).jpg
./wallphotos-old/8020_1600x1200-wallpaper-cb1267712767.jpg
./wallphotos-old/3664_1600x1200-wallpaper-cb1267712118.jpg
./wallphotos-old/17801_1600x1200-wallpaper-cb1273013536.jpg
$

head and tail Command Related

commandline session

following session display may not be accurate

$sudo head dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.46-1+deb7u1
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64 root=UUID=3219e911-81fb-4d52-ba7c-117a58d09312 ro quiet
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009e800 (usable)
[    0.000000]  BIOS-e820: 000000000009e800 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 000000009e5e7000 (usable)
[    0.000000]  BIOS-e820: 000000009e5e7000 - 000000009e619000 (reserved)
$sudo head ls
head: cannot open `ls' for reading: No such file or directory
$sudo head -6 dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.2.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.46-1+deb7u1
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64 root=UUID=3219e911-81fb-4d52-ba7c-117a58d09312 ro quiet
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009e800 (usable)
$sudo head -3 auth.log daemon.log
==> auth.log  daemon.log <==
Nov 10 20:11:07 debian acpid: starting up with netlink and the input layer
Nov 10 20:11:07 debian acpid: 1 rule loaded
Nov 10 20:11:07 debian acpid: waiting for events: event logging is off
$tail -f iostat
tail: cannot open `iostat' for reading: No such file or directory
$tail -f dmesg
tail: cannot open `dmesg' for reading: Permission denied
$sudo tail -f dmesg
[   14.815581] NET: Registered protocol family 31
[   14.815587] Bluetooth: HCI device and connection manager initialized
[   14.815593] Bluetooth: HCI socket layer initialized
[   14.815603] Bluetooth: L2CAP socket layer initialized
[   14.815824] Bluetooth: SCO socket layer initialized
[   14.847521] Bluetooth: RFCOMM TTY layer initialized
[   14.847531] Bluetooth: RFCOMM socket layer initialized
[   14.847535] Bluetooth: RFCOMM ver 1.11
[   14.924529] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   14.924536] Bluetooth: BNEP filters: protocol multicast
^C$

a typical video tutorial related

NO WARRANTY

[youtube https://www.youtube.com/watch?v=QPT64WvDN-Q?rel=0&w=560&h=315]

Debian GNU/Linux Easter Eggs and Game Related

commandline session

the following session may not have an accurate display.

$apt-get help
$apt-get help | tail
  -f  Attempt to correct a system with broken dependencies in place
  -m  Attempt to continue if archives are unlocatable
  -u  Show a list of upgraded packages as well
  -b  Build the source package after fetching it
  -V  Show verbose version numbers
  -c=? Read this configuration file
  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual
pages for more information and options.
                       This APT has Super Cow Powers.
$apt-get moo
         (__)
         (oo)
   /------/
  / |    ||
 *  /---/
    ~~   ~~
...."Have you mooed today?"...
$aptitude -v moo
There really are no Easter Eggs in this program.
$aptitude -vv moo
Didn't I already tell you that there are no Easter Eggs in this program?
$aptitude -vvv moo
Stop it!
$aptitude -vvvv moo
Okay, okay, if I give you an Easter Egg, will you go away?
$aptitude -vvvvv moo
All right, you win.

                               /----
                       -------/      
                      /               
                     /                |
   -----------------/                  --------
   ----------------------------------------------
$aptitude -vvvvvv moo
What is it?  It's an elephant being eaten by a snake, of course.
$aptitude -vvvvvvv moo
What is it?  It's an elephant being eaten by a snake, of course.
$aptitude -vvvvvvvv moo
What is it?  It's an elephant being eaten by a snake, of course.
$/usr/games/cowsay hello Jeffrin
 _______________

 ---------------
           ^__^
           (oo)_______
            (__)       )/
                ||----w |
                ||     ||
$/usr/games/cowsay -e +
^C
$/usr/games/cowsay -e + hello
 _______

 -------
           ^__^
           (+)_______
            (__)       )/
                ||----w |
                ||     ||
$

a video tutorial related

[youtube https://www.youtube.com/watch?v=HVqGVVdUFag?rel=0&w=560&h=315]

DEBUG Method Development . LOG.0.2

method to downgrade debian from a unstable tree to stable tree

step 1
put the following content in /etc/apt/preferences.d/default
Package: *
Pin: release a=stable
Pin-Priority: 1001

step 2
make your sources.list to stable pointers.
step 3
apt-get update
apt-get upgrade
next do sensibly


To Fix Things, work on a stable system and chroot to the broken system
The command “ar” can be used to extract files from debian binary package
export PYTHONPATH=/usr/lib/python2.7 for debian related for showing python module path related.

the above content may not be accurate.

Handling File Name With Space

commandline session

$ > test file
Usage: file [-bchikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
            [-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
       file -C [-m magicfiles]
       file [--help]
$ls
test
$ls -l
total 0
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test
$> "test file"
$ls
test  test file
$ls -l
total 0
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test file
$> test
test       test file
$> test  newfile
bash: newfile: command not found
$> test newfile
$ls
test  test   test file  test newfile
$ls -l
total 0
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  9 00:00 test
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test file
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  9 00:00 test newfile
$> test  newfile
$ls -l
total 0
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  9 00:00 test
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  8 23:59 test file
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  9 00:00 test newfile
-rw-r--r-- 1 jeffrin jeffrin 0 Nov  9 00:01 test  newfile
$

the following video tutorial content may not be fully accurate

[youtube https://www.youtube.com/watch?v=s72WS6xGpH8?rel=0&w=560&h=315]

watch – execute a program periodically

commandline session

following commandline session may not be accurate.

$vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 1  0      0 2246368  32720 497284    0    0   217    10  236  436  3  1 92  3
$watch vmstat
$watch -n 0.5 vmstat
$watch -n 0.5 iostat
$watch -n 0.5 iostat
$iostat
Linux 3.12.0 (debian) 	Friday 08 November 2013 	_x86_64_	(2 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.64    0.01    2.31    1.80    0.00   89.24

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda               8.82       272.09        51.03     696015     130532

$

the following video tutorial content may not be accurate

[youtube https://www.youtube.com/watch?v=8T_GK9dT7ts?rel=0&w=560&h=315]

GNU/Linux Command: Viewing Resources

commandline session

$df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       224G  7.5G  205G   4% /
udev             10M     0   10M   0% /dev
tmpfs           336M  664K  336M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           672M   19M  1004M   3% /run/shm
$du -sh /etc/
du: cannot read directory ‘/etc/polkit-1/localauthority’: Permission denied
du: cannot read directory ‘/etc/ssl/private’: Permission denied
7.6M	/etc/
$sudo du -sh /etc/
[sudo] password for jeffrin:
7.7M	/etc/
$free
             total       used       free     shared    buffers     cached
Mem:       3440280    1430032    2010248          0      93552     501752
-/+ buffers/cache:     834728    2605552
Swap:            0          0          0
$sudo du -sh /usr/
3.6G	/usr/
$sudo du -sh
2.6G	.
$

following video tutorial content may not be accurate

[youtube https://www.youtube.com/watch?v=CeDfZQGFIk4?rel=0&w=560&h=315]