ls - l does it , but i dont know how to use it for getting last entry
Maybe it is just me, but i sense a misconception about how Unix commands work.
In fact not ls -l does it, but ls does it. "ls" is a command and it shows a directories contents. How it does this can be widely influenced by using certain options.
You already saw the "-l" option at work, which changes the display format from the default short (only filenames) to a long (filemode, owner, group, etc.) listing.
Now, here is a general rule for working with Unix: nobody knows ALL the options every command has - not a single person! This is what "man" pages are for, which you invoke by
Think of these as like a telephone directory: you don't have to know all the numbers by heart, you just have to know the name and the city. In Unix you have to know that "ls" shows directories contents and to find out how you manage to get some specific listing of these contents you look up the man page if you can find something which suits your purpose.
So i suggest you try that and report back here. If you find anything worthwile we will take it from there.
Hello All,
I have written shell script whcih at the max 3 parameters.
When only one commandline argument and other two command line arguments are passed as empty string like
eg : archive ' ' ' '
Then i need to check whether the commandline... (12 Replies)
Hi Masters.....
I have problem !!!
I need to check number of records in a file and if it is zero or file is empty i need to do some task.
if ; then
echo "File s empty"
else
echo "Not empty"
fi
so how to check this condition.
I used wc -l < filename.txt => 1 for zero records
same result... (1 Reply)
How do I check if a file is empty in a sh script
I want to test in my shell script if the output file is empty and if it is do one thing and if it isnt empty do another?
any ideas? (8 Replies)
I have the list of users in user.log, under each user folder there is sub1 folder is there. i want to check whether sub1 is empty or not, if it is empty i have to skip that user user folder and iterate next user folders. i have the sample code,its not giving not proper results.
while read line... (8 Replies)
I need to check if a directory is empty using an if condition
in the pseudocode below
if ; then
else
although i looked at a few forums on this topic, I left feeling a little unclear and i could not use the command successfully
what can i substitute in the if conditon above,... (2 Replies)
Hi All,
I have a requirement to check all the files in a directory and mail non empty files
Files are in csv format , i need to skip header while checking
pls help
Thanks (12 Replies)
1.pls tell me the command for checking whether a given directory is empty or not .
2. can i check what is the last copied item in a directory .
and i yes , i want to move that last copied item in another directory .
pls help me with shell code for these two tasks
thanks (1 Reply)
Hi gurus ,
I have two files and i want to perform different action based on the condition if both or either is empty
If
then
Do something
elif
then
do something
elif
then
do something
else
do something
fi
I have tried the below bt its not... (4 Replies)
Hello
So i have that script collection, in which i have a single script to create a configuration file.
In there, i have multiple occourences of something like this:
prj_title=$(tui-read "What is the TITLE? ($prj_name):")
] && prj_title="${prj_name/_/ }"
They all work as expected, if... (5 Replies)
I have a script, which is supposed to run 1 day of the month, connect to remote server certain directory, find files, tar the, and copy
find . -ctime -1 | tar -cvf transfer_dmz_start_monthly.tar *${Today}*.*;
if
then
echo "Cannot create a tar file, the terminated... (2 Replies)
Discussion started by: digioleg54
2 Replies
LEARN ABOUT SUNOS
nisls
nisls(1) User Commands nisls(1)NAME
nisls - list the contents of a NIS+ directory
SYNOPSIS
nisls [-dglLmMR] [name...]
DESCRIPTION
For each name that is a NIS+ directory, nisls lists the contents of the directory. For each name that is a NIS+ object other than a direc-
tory, nisls simply echos the name. If no name is specified, the first directory in the search path is listed. See nisdefaults(1).
OPTIONS
The following options are supported:
-d Treat NIS+ directories like other NIS+ objects, rather than listing their contents.
-g Display group owner instead of owner when listing in long format.
-l List in long format. This option displays additional information about the objects such as their type, creation time, owner, and
access rights.
The access rights are listed in the following order in long mode: nobody, owner, group owner, and world.
-L This option specifies that links are to be followed. If name actually points to a link, it is followed to the linked object.
-m Display modification time instead of creation time when listing in long format.
-M Master only. This specifies that information is to be returned from the master server of the named object. This guarantees that
the most up to date information is seen at the possible expense that the master server may be busy.
-R List directories recursively. This option will reiterate the list for each subdirectory found in the process of listing each name.
ENVIRONMENT VARIABLES
NIS_PATH If this variable is set, and the NIS+ name is not fully qualified, each directory specified will be searched until
the object is found. See nisdefaults(1).
EXIT STATUS
The following exit values are returned:
0 Successful operation.
1 Operation failed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWnisu |
+-----------------------------+-----------------------------+
SEE ALSO nisdefaults(1), nisgrpadm(1), nismatch(1), nistbladm(1), nis_objects(3NSL), attributes(5)NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are
available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html.
SunOS 5.10 10 Dec 2001 nisls(1)