Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, February 7, 2014

Different file size on server and local file system

I got a case when file on server (Solaris) have different size from what I have on Local PC (Ubuntu 12.04),

[user@server ~]$ du -h /var/tmp/file.csv
548K    /var/tmp/file.csv
[roman@laptop ~]$ du --apparent-size -h /var/tmp/file.csv
1.9M    /var/tmp/file.csv

[user@server ~]$ ls -lh /var/tmp/file.csv
-rw-r--r-- 1 sb sb 1.9M Feb  7 13:59 /var/tmp/file.csv
[user@server ~]$ du -h /var/tmp/file.csv
548K    /var/tmp/file.csv
[user@server ~]$ du --apparent-size -h /var/tmp/file.csv
1.9M    /var/tmp/file.csv

from man:
    --apparent-size
              print apparent sizes,  rather  than  disk  usage;  although  the
              apparent  size is usually smaller, it may be larger due to holes
              in (`sparse') files, internal  fragmentation,  indirect  blocks,
              and the like



Wednesday, June 5, 2013

Bulk files rename in linux


Task: in folder /www/logs/jobs/ rename all files started from "rp-repgen" to "repgen", in other words change prefix of files.

Solution:
 for file in /www/logs/jobs/rp-repgen*; do dest="${file/rp-repgen/repgen}";mv $file $dest; done

Friday, November 9, 2012

Ubuntu get popularity from other Linuxes

Ubuntu become more and more popular, but is it due to new users that come from Windows ?

I do believe to wikipedia statistics as it only resource that is visited by all internet user no matter what OS or browser they use.

data sources links:
http://stats.wikimedia.org/wikimedia/squids/SquidReportOperatingSystems.htm
http://stats.wikimedia.org/archive/squid_reports/2011-10/SquidReportOperatingSystems.htm

Result show that Ubuntu get popularity from other Linux systems, but we see 0.07% of grow :) in general.
Does it mean that Linux users become more lazy and choose Linux that works out-of-the-box, and fed-up with doing all from scratch ? or it is just statistical rounding that significant grow other OS in amount of users
red - decrease of popularity.
green - grow of popularity.

Thursday, August 30, 2012

Linux command 'Less' short list of commands

Linux command 'Less' short commands:
source, source2.

h - show help

f - scroll page forward
b - scroll page backward
g or "<" - go to begin of the file
G or ">" - go to end of the file

/PATERN - search
n - search for next appearance
N - search for previous appearance


tail mode:

Press Shift-F. This will take you to the end of the file, and continuously display new contents. In other words, it behaves just like tail -f.
To start less in the tail mode, execute:
$ less +F /var/log/messages
To scroll backwards, you must first exit the follow mode by pressing Control-c.

reload latest lines from file, one time 'tail mode':
Shift+G - got to the end of file
Shift + ">" - load till the end of file, press few times if you expect changes to file.