Posts

Showing posts from November, 2009

Changing Date and Time in Linux

Syntex:
1. date -s "DD Mon YYYY hh:mm:ss"

2. date set="DD Mon YYYY hh:mm:ss"

3. date MMDDhhmmYYYY.ss

Example:
1. date -s "28 NOV 2008 13:45:00"

2. date set="28 NOV 2008 13:45:00"

3. date 112813452009

Setting Time in Linux

Syntex:
date +%T -s "hh:mm:ss"

Example:
date +%T -s "10:13:13"

Deleting Files/Folders based on OWNERSHIP

1. List the files and directories.

$ ls -lah

total 52K
drwxrwxrwt 11 root root 4.0K Nov 4 03:52 .
drwxr-xr-x 25 root root 4.0K Oct 6 03:54 ..
srwxr-xr-x 1 george george 0 Oct 8 00:47 .dguardianipc
srwxr-xr-x 1 george george 0 Oct 8 00:47 .dguardianurlipc
-rw-r--r-- 1 root root 0 Nov 4 03:52 file1
-rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file2
-rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file3
-rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file4
-rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file5
-rw-r--r-- 1 root root 0 Nov 4 03:52 file6
-rw-r--r-- 1 root root 0 Nov 4 03:52 file7
drwxrwxrwt 2 root root 4.0K Oct 1 07:55 .font-unix
drwxrwxrwt 2 root root 4.0K Oct 1 07:55 .ICE-unix
drwxr-xr-x 2 root root 4.0K Nov 4 03:43 test1
drwxr-xr-x 2 root root 4.0K Nov 4 03:51 test2
drwxr-xr-x 2 root root 4.0K Nov 4 03:43 test[2-7]
drwxr-xr-x 2 root root 4.0K Nov 4 03:43 test2-7
drwxr-xr-x 2 george george 4.0K Nov 4 03:51 test3
dr…