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]

GNU/Linux Commands for Beginners: which and whatis

commandline session

$which ls
/bin/ls
$which firefox
/usr/bin/firefox
$which grep
/bin/grep
$which whatis
/usr/bin/whatis
$whatis which
which (1)            - locate a command
$whatis whatis
whatis (1)           - display manual page descriptions
$whatis linux
linux: nothing appropriate.
$whatis kcore
kcore: nothing appropriate.
$whatis mysql
mysql: nothing appropriate.
$whatis locate
locate (1)           - find files by name

following video tutorial content may not be accurate

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

GNU/Linux command : Changing Passwords

commandline session

$sudo -
[sudo] password for jeffrin:
sudo: -: command not found
$
$su -
Password:
root>passwd -e jeffrin
passwd: password expiry information changed.
root>exit
logout
$login jeffrin
login: Cannot possibly work without effective root
$sudo login jeffrin
[sudo] password for jeffrin:
sudo: Account or password is expired, reset your password and try again
Changing password for jeffrin.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
Password:
Last login: Sat Nov  2 22:01:20 IST 2013 on pts/0
Linux debian 3.11-1-amd64 #1 SMP Debian 3.11.5-1 (2013-10-17) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
$exit
logout
$sudo -s
[sudo] password for jeffrin:
Sorry, try again.
[sudo] password for jeffrin:
sudo: 1 incorrect password attempt
$su -
Password:
root>passwd jeffrin
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root>

following video tutorial content may not be accurate

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

Git server and SSH Debian HOWTO

the following content may not be accurate and detailed

Server

1. apt-get install git
2. apt-get install  git-daemon-sysvinit
3. mkdir  -p /home/user/project.git
4. cd /home/user/project.git
5. git init
6. git config --global user.name "Your Name"
7. git config --global user.email "you@example.com"
8. git commit -a
9. touch .git/git-daemon-export-ok
10. git config --bool core.bare true
11. edit /etc/init.d/git-daemon file and change to
"GIT_DAEMON_BASE_PATH=${GIT_DAEMON_BASE_PATH:-/home/user}"
12. service git-daemon restart

Client

1. git clone ssh://user@server/home/user/project.git