"ls -tl directory1" will list files to be sorted in mtime, but I don't want to see all the files in each directory, I want to only see output the last line (the oldest mtime) for each directory.
How can I only list the last line
Thank you.
Kind regards,
- hce
Moderator's Comments:
Please use code tags next time for your code and data. Thanks
I am trying to find socail security numbers in files in (and under) a specific directory and output a list of the files where they are found... the format would be with no dashes just 9 numeric characters in a row.
I have tried this:
find /DirToLookIn -exec grep '\{9\}' /dev/null {} \; >>... (1 Reply)
Hello,
I have not been able to find what I'm looking for via searching the forum. I could use some help with an awk script or one-liner to solve this simple problem.
I have two files. If $1 and $2 from file1 match $1 and $2 from file2, print the whole line from file2.
Example file1
... (2 Replies)
Hi All,
Below is the 2 different ouputs of the command "ls -lrt", my question is what exactly "total 0" & "total 8" means here ?
$ ls -rtl
total 0
-rw-r--r-- 1 oracle dba 0 Feb 10 20:16 c
-rw-r--r-- 1 oracle dba 0 Feb 10 20:16 b
-rw-r--r-- 1... (1 Reply)
Hello I am trying to develop a shell script that takes a text file such as this...
E-mail@ Soc.Sec.No. *--------Name-----------* Class *School.Curriculum.Major.* Campus.Phone
JCC2380 XXX-XX-XXXX CAREY, JULIE C JR-II BISS CPSC BS INFO TECH 412/779-9445
JAC1936 XXX-XX-XXXX... (7 Replies)
Gents,
I have a file like this.
1 1
1 2
2 3
2 4
2 5
3 6
3 7
4 8
5 9
I would like to get something like it
1 1 2
2 3 4 5
3 6 7
Thanks in advance for your support :b: (8 Replies)
Hi,
I've a list of files
ac_info.tps, subscription_array.tps, .......and many other files
one of the file, bin_range_list.tps has the following content
CREATE OR REPLACE TYPE "BIN_RANGE_LIST" AS TABLE OF BIN_RANGE_ELEM;
/
grant execute on... (4 Replies)
Hi ,
I'm trying to list the files and output is written to a file. But when I execute the command , the output file is being listed. How to exclude it ?
/tmp
file1.txt
file2.txt
ls -ltr |grep -v '-' | awk print {$9, $5} > output.txt
cat output.txt
file1.txt
file2.txt
output.txt (8 Replies)
This is my problem, I am using the following code to extract the file names with specific strings 0.01:
find ./ -name "*.txt" -exec grep -H '0.01' {} +
It works wonders with a small sample. However, when I use it in a real scenario it produces an empty file -even though I am sure there are... (11 Replies)
I have two file as given below which shows the ACL permissions of each file. I need to compare the source file with target file and list down the difference as specified below in required output. Can someone help me on this ?
Source File
*************
# file: /local/test_1
# owner: own
#... (4 Replies)
Discussion started by: sarathy_a35
4 Replies
LEARN ABOUT HPUX
ch_rc
ch_rc(1M)ch_rc(1M)NAME
ch_rc - change system configuration file
SYNOPSIS
root] {parameter|parameter=value}...] [file...]
DESCRIPTION
manages the addition, modification, removal, and retrieval of information stored in files having the format of those in the directory.
Parameter names are treated as strings. Thus, has no special meaning to in relation to other parameters named
Options
file Specify the file(s) to be used as the configuration database. If no file is specified, the set of files used by defaults
to and all files in the directory.
Modification and deletion of configuration parameters occurs in the file where the parameter is found.
Add or modify a parameter definition. For each parameter specified
on the command line, if the parameter is found in the specified (or default) files, it is modified to reflect the speci-
fied value. If the parameter is not found, it is added to the specified file(s).
If a new parameter is being defined, one or more files must be specified on the command line; the specified files are
those in which the parameter will be defined.
Remove a parameter definition. For each parameter name specified
on the command line, remove any occurrence of that parameter from the specified file(s).
List configuration values. For each parameter specified on the
command line, output every definition of the parameter from the specified file(s). Output consists of only the values,
one per line.
Specify a parameter name or name/value pair. If a name and value
is expected, but only a name is specified, the value will be set to the empty string. For example, specifying or will
result in and respectively.
Due to shell quoting rules, if you need a quoted parameter value, you must protect the quotes from the shell. For exam-
ple,
yields:
which is an error, whereas,
yields:
Verbose. When used with the
option, the option causes a verbose listing to be output. This listing includes a filename followed by the entire line
containing the specified parameter for each occurrance of the parameter.
The option is used to list all occurances of array parameters matching the parameters specified on the command line.
For example,
may emit the following output:
Normally, the files specified on the command line are used as specified.
By specifying a root directory with the option, all files (including the default files if none are specified) will be
interpreted relative to root.
For example, if root is specified as and is specified on the command line, it will be interpreted as
RETURN VALUE
exits with one of the following values:
0 add/delete/list successful
1 command line syntax/usage error
2 can not access one or more of the listed (or default) files
3 can not open/create/write file
4 memory error
5 no files specified on command line for add option
EXAMPLES
Files in the directory have the following format:
WARNINGS
does not interpret configuration files; it only does pattern matching. As a result, if comments appear on lines containing parameter defi-
nitions, the comments will also appear in output when using the option.
cannot parse multiple parameter definitions which occur on the same line of a file.
AUTHOR
was developed by HP.
FILES
system configuration database driver file
directory containing system configuration files
SEE ALSO rc.config(4).
ch_rc(1M)