Sponsored Content
Top Forums Shell Programming and Scripting How do i collect date and time for list of files in a directory Post 302119869 by Shell_Life on Friday 1st of June 2007 09:25:40 AM
Old 06-01-2007
Laknar,
Be advised that if the file is more than six months old,
in place of time it will be the year:
Code:
-r--r--r--   1 mmzes sdev    23093 Feb 20 11:30 abc.sh
-rw-r-----   1 mmzes sdev     1372 Jan 19 13:21 a
-rw-r-----   1 mmzes sdev      683 Jan 19 13:21 b
-r-xr-xr-x   1 mmzes sdev     4341 Jan 17 14:43 file1
-r--r--r--   1 mmzes sdev     3055 Oct 31  2006 file2
-r-xr-xr-x   1 mmzes sdev    11350 Aug 17  2006 ab.sh
-r--r--r--   1 mmzes sdev     7208 Jul 27  2006 st.sh
-r-xr-xr-x   1 mmzes sdev     8492 Jul 18  2006 ad.txt


Last edited by Shell_Life; 06-01-2007 at 03:04 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List files created between specific date and time

Hi I need to write a script to list files in a directory created within specific date and time for eg list files created between Apr 25 2007 11:00 to Apr 26 2007 18:00. and then i have to count them Any suggestions pls ? (3 Replies)
Discussion started by: jazjit
3 Replies

2. Shell Programming and Scripting

How do i collect Date & Time from Different Directories in a script

How do i collect Date & Time from Different Directories in a script The script iam using for a single directory is : ls -l | grep awk '{print $8}' (2 Replies)
Discussion started by: laknar
2 Replies

3. UNIX for Dummies Questions & Answers

List files with date and time stamps only

Hi there, I'm using terminal on mac and using the ls -l command to list all the files in a directory. However, I only want to display the date and time stamp of each file rather than permissions, owner, group etc... Is this possible? Many thanks in advance Dave (2 Replies)
Discussion started by: davewg
2 Replies

4. UNIX for Dummies Questions & Answers

How to always display date/time regardless of directory?

I found via Google a way to show the date and time stamp once I log in. However, whenever I cd to another directory it doesn't display the correct path. Here are the relevant parts from my .kshrc : unset _h _m _s eval $(date "+_h=%H ;_m=%M ;_s=%S") ((SECONDS =... (3 Replies)
Discussion started by: Mike F.
3 Replies

5. Shell Programming and Scripting

How to collect all the list of files along with the permissions

Hi guys, I have one problem. I need collect the list files along with the file permissions in all directories in one server. Is their any easy way to collect using any commands or any scripts? Advance Thanks :) (2 Replies)
Discussion started by: kartheek
2 Replies

6. Shell Programming and Scripting

List Files Based On Time & Date

Hi All, I am using HP Unix. I want to list files which are created 5 minutes before on the same day as well as before today's date. I checked all the forums and the commands provided there does not work on HP Unix. Can you please help me on this? Your help is highly aprreciated. Thanks and... (3 Replies)
Discussion started by: angshuman
3 Replies

7. Shell Programming and Scripting

To get the files in a directory for the given date (User entered date)

Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user. For example if a directory contains files as below : > ll total 41 -rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh -rw-rw-r-- 1 psn psn ... (10 Replies)
Discussion started by: ramprabhum
10 Replies

8. Shell Programming and Scripting

How to collect the logs with in two time stamp ?

Hi Gurus I need to collect the logs between two time stamp... The log files 12 hours format (ex- Nov 14, 2013 12:10:16 AM UTC) I tried the below commands but no luck. awk '$0 >= "Nov 14, 2013 9:40:01" && $0 <= "Nov 14, 2013 9:55:01"' file sed -n '/Nov 14, 2013 7:58:00 PM UTC/,/Nov 14, 2013... (5 Replies)
Discussion started by: zenkarthi
5 Replies

9. Shell Programming and Scripting

How to list files that are not first two files date & last file date for every month-year?

Hi All, I need to find all files other than first two files dates & last file date for month and month/year wise list. lets say there are following files in directory Mar 19 2012 c.txt Mar 19 2012 cc.txt Mar 21 2012 d.txt Mar 22 2012 f.txt Mar 24 2012 h.txt Mar 25 2012 w.txt Feb 12... (2 Replies)
Discussion started by: Makarand Dodmis
2 Replies

10. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies
mcxrand(1)							  USER COMMANDS 							mcxrand(1)

  NAME
      mcxrand - random shuffling, removal, addition, and perturbation of edges of graphs

  SYNOPSIS
      mcxrand [options]

      mcxrand -gen K -add N -new-g-mean f    # random graph on K nodes, N edges
      mcxrand -imx <name> -remove N -add N   # remove then add edges
      mcxrand -imx <name> -shuffle N	     # shuffle N edge pairs
      mcxrand -imx <name> -noise-radius f    # add noise to add weights

      mcxrand -pa N/m # preferential attachment generation

      mcxrand  [-imx  <fname> (input matrix)] [-o <fname> (output matrix to <fname>)] [--write-binary (write output in binary format)] [-gen <num>
      (generate new graph)] [-pa <N>/<m> (preferential attachment)] [-remove <num> (remove <num> edges)] [-add <num>  (add  <num>  edges  not  yet
      present)]  [-shuffle  <num>  (shuffle  edge  pair  <num> times)] [-noise-radius <num> (maximum spread to add noise with)] [-noise-sdev <num>
      (noise standard deviation)] [-noise-range <num> (noise range factor)] [-edge-min <num> (absolute	edge  weight  minimum)]  [-edge-max  <num>
      (absolute  edge  weight  maximum)]  [-new-g-mean <num> (mean for new edges (Gaussian))] [-new-g-sdev <num> (standard deviation for new edges
      (Gaussian))] [-new-g-radius <num> (maximum spread for new edges (Gaussian))] [-new-g-min <num> (lower bound selection (Gaussian))]  [-new-g-
      max  <num>  (upper bound selection (Gaussian))] [-skew <num> (skew towards min or max)] [-h (print synopsis, exit)] [--apropos (print synop-
      sis, exit)] [--version (print version, exit)]

  DESCRIPTION
      This utility is a recent addition to the mcl suite and the schemes explained below will likely be evolved,  simplified,  and  extended  with
      future releases.

      The --shuffle, -gen and -pa options can be deemend stable and robust. The options that determine edge weight perturbation and generation are
      likely to be subject to revision in the future.

      The input graph/matrix, if specified with the -imx option, has to be in mcl matrix/graph format.	You can use label input instead by prepro-
      cessing the label input with mcxload(1), i.e.

	 mcxload -abc <label-file> | mcxrand [options]

      Refer to mcxio(5) for a description of these two input formats.  By default mcxrand reads from STDIN. Change this with the -imx option.

      mcxrand  can  randomly remove and add edges to a graph, or add gaussian noise to the edge weights of a graph. It can also shuffle edge pairs
      while preserving the degree sequence of the graph.  In removal mode (-remove <num>) and in addition mode (-add <num>) mcxrand  enforces  arc
      symmetry	by  only  working  with  edges w(i,j) where i < j and symmetrifying the result and adding any loops that were present in the input
      graph just before the output stage.

      In perturbation mode (-noise-radius, with no other mode specified) the input can be any graph.

      Shuffle mode (-shuffle <num>) requires an undirected graph but will only fail when it picks an arc for which the arc in the  reverse  direc-
      tion  is not present. This means it may or may not fail on directed input depending on the random choices. It does not check equality of the
      two arc weights and randomly picks one to represent the edge weight.

      Edge removal, edge creation, and edge perturbation are applied in this order if both are specified. Edge shuffling presently cannot be  com-
      bined with one of the previous modes.

      A  random  graph	can be generated with -gen k, which specifies the number of nodes the graph should have. It is equivalent with pasing (the
      file name of) an empty graph of the same dimensions as the argument to -imx.

      When adding (i.e. creating) edges, the default is to use the uniform distribution for new  edge  weights	ranging  in  some  interval.   The
      default interval is [0,1] and can be modified using the -edge-min min and -edge-max max options.	A Gaussian edge weight distribution can be
      obtained by specifying -new-g-mean num. The standard deviation is by default 1.0 and can be altered  with  -new-g-sdev num.   Currently  the
      edge  weigths  are  generated  within the interval [mean-radius, mean+radius] where radius is specified with -new-g-radius. They are further
      selected to lie within the interval [L,R] if and only if -new-g-min L and -new-g-max R have been specified.

      For both uniform and Gaussian edge creation the edge weights can be skewed towards either side of the distribution with -skew c. Skewing	is
      applied  by  mapping  the edge weights to the interval [0,1], applying the function x^c, and remapping the resulting number.  For values c<1
      this skews the edge weights towards the right bound and for values c>1 this skews the edge weights towards the left bound.  This is a rather
      crude approach that will likely be changed in the future.

      Edge  weights  can  be  perturbed by specifying -noise-radius radius.  This sets the maximum perturbation allowed. Noise is generated with a
      standard deviation that is by default set to 0.5 and can be altered using -noise-sdev num.  Values are generated in the interval [-fac*sdev,
      fac*sdev]  where	fac is set with -noise-range fac.  This interval is mapped to the interval [-radius, radius] before the resulting value is
      added to the actual edge weight.	This becomes the new value. If an interval [L,R] is explicitly specified using -edge-min L and -edge-max R
      then the new value will be accepted only if it lies within the interval, otherwise the edge will not be perturbed.

  OPTIONS
      -imx <fname> (input matrix)
	The file name for input. STDIN is assumed if neither -imx nor -gen num is specified.

      -o <fname> (output matrix to <fname>)
	The file to write the transformed matrix to.

      --write-binary (write output in binary format)
	Write the output matrix in native binary format.

      -shuffle <num> (shuffle edge pair <num> times)
	Shuffle  edge pair <num> times. An edge shuffle acts on two randomly chosen edges edges w(a,b) and w(c,d) where all the nodes must be dif-
	ferent. If either none of the edges in w(a,c), w(b,d) or none of the edges in w(a,d), w(b,c) exists the original two edges are removed and
	is replaced by an edge pair for which both edges did not exist before.

      -pa <N>/<m> (preferential attachment)
	This generates a random graph using preferential attachment.  In this model new nodes are sequentially added to a graph.  Each new node is
	connected with <m> of the existing nodes (including nodes previously added), where the likelihood of picking an existing node  is  propor-
	tional to the edge degree of that node. During construction multiple edges between two nodes are allowed (each with weight one), and these
	are collapsed by adding their weights before output.

      -remove <num> (remove <num> edges)
	Remove this many edges from the input graph.

      -add <num> (add <num> edges not yet present)
	Create this many new edges.

      -gen <num> (node number)
	Use in conjunction with -add to generate a random graph on <num> nodes.

      -noise-radius <num> (maximum spread to add noise with)
      -noise-sdev <num> (standard deviation)
      -noise-range <fac> (number of standard deviations allowed)
	See the discussion in DESCRIPTION.

      -edge-min <num> (global edge weight minimum)
      -edge-max <num> (global edge weight maximum)
	See the discussion in DESCRIPTION.

      -skew <num> (skew towards min or max)
	See the discussion in DESCRIPTION.

      -new-g-mean <num> (mean to generate new edges with)
      -new-g-sdev <num> (standard deviation to generate new edges with)
      -new-g-radius <num> (maximum spread to generate new edges with)
      -new-g-min <num> (lower bound selection (Gaussian))
      -new-g-max <num> (upper bound selection (Gaussian))
	See the discussion in DESCRIPTION.

  SEE ALSO
      mcxio(5), and mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  mcxrand 12-068						      8 Mar 2012							  mcxrand(1)
All times are GMT -4. The time now is 11:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy