Friday, March 26, 2010

ls --color Decorating Directory Listing

The change the colours for your directory listing
Edit file: /etc/DIR_COLORS, copy the only changed ones in ~/.dircolors.

Next login, you get it.

file: /etc/DIR_COLORS
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
#FILE 00 # normal file, use no color at all
RESET 0 # reset to "normal" color
DIR 01;34 # directory
LINK 01;36 # symbolic link (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)

Monday, March 1, 2010

FTP GET remote file timestamp

Check the remote server file time
login to ftp server
ftp servername
do
ls -ltr

will show list of files say we have
ftp> ls -ltr

227 Entering Passive Mode (10,146,172,50,66,132)
150 Here comes the directory listing.
-rw-r--r-- 1 50005 50005 5250 Mar 01 08:15 tech-talk
226 Directory send OK.


use modtime filename to check the file modified timestamp, ftp always shows in GMT time

ftp> modtime tech-talk

tech-talk 03/01/2010 08:15:00 GMT