Sponsored Content
Full Discussion: find a file
Top Forums Shell Programming and Scripting find a file Post 302270876 by reddyrajal on Tuesday 23rd of December 2008 05:49:50 AM
Old 12-23-2008
try this

echo -n "enter date: ";read DATE && ll --time-style="+%F %T" | awk 'NR>1{ for(i=6;i<NF;i++){printf "%s ",$i} print $NF }' | grep ^"$DATE"


you need to give date in 2008-12-22

sample test you can give time also or you can give simply 2008 it will give all files with edited in 2008

enter date: 2008-12-22 16
2008-12-22 16:15:00 file2_tmp
2008-12-22 16:14:51 file_tmp

enter date: 2008-12-22
2008-12-22 12:07:14 2
2008-12-22 14:31:36 dec-13.txt
2008-12-22 20:29:54 file
2008-12-22 19:43:32 file1
2008-12-22 15:42:08 file2
2008-12-22 16:15:00 file2_tmp
2008-12-22 16:14:51 file_tmp
2008-12-22 14:58:03 file.txt
2008-12-22 17:03:30 list
2008-12-22 14:04:58 list.txt
2008-12-22 15:39:40 test2
2008-12-22 12:59:58 testing
2008-12-22 14:35:49 test.txt
2008-12-22 14:19:09 TODAY.txt
2008-12-22 14:01:10 unsub.txt

enter date: 2008
2008-12-22 12:07:14 2
2008-12-22 14:31:36 dec-13.txt
2008-12-17 19:20:27 Desktop
2008-12-17 18:19:37 Documents
2008-12-23 14:05:02 Download
2008-12-23 13:21:36 error
2008-12-22 20:29:54 file
2008-12-22 19:43:32 file1
2008-12-22 15:42:08 file2
2008-12-22 16:15:00 file2_tmp
2008-12-22 16:14:51 file_tmp
2008-12-22 14:58:03 file.txt
2008-12-15 18:57:10 Install
2008-12-22 17:03:30 list
2008-12-22 14:04:58 list.txt
2008-12-23 15:14:54 Music
2008-12-05 15:44:08 Photos
2008-12-17 14:45:54 Pictures
2008-12-05 13:35:06 Public
2008-12-19 21:13:58 sample
2008-12-18 13:47:17 scripts
2008-12-23 12:48:16 sort1.tmp
2008-12-15 12:53:56 temp.txt
2008-12-22 15:39:40 test2
2008-12-22 12:59:58 testing
2008-12-19 12:28:21 test.sh
2008-12-22 14:35:49 test.txt
2008-12-15 17:05:13 Videos
2008-12-07 11:28:34 workspace
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find a file in UNIX without find command?

given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies

2. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

3. UNIX for Dummies Questions & Answers

How to find a file whick is consuming larger disk space in file system

Hello, Can anybody please tell me the command to find out the filesystem or a file which is consuming larger disk space sing i want to find out the file and want to compress it please help me out any help would be appreciated (6 Replies)
Discussion started by: lokeshpashine
6 Replies

4. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

5. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

6. Shell Programming and Scripting

Find multiple string in one file using find command

Hi, I want find multiple string in one file using find coomand. And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies

7. Shell Programming and Scripting

wanted to find both link file and ordinary file using single find command

find . -type fl o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies

8. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

9. Shell Programming and Scripting

Can you use find with ps or doing find excluding file in use

Hi, I am currently using the find below to remove old files. I am redirecting the listing to a file and then use a while-loop and do a rm cd ${directory} find . \( ! -name . -prune \) \( -type f -name "*.trc" -mtime +10 \) | sed 's#^./##' | sed "s#^#${directory}/#" 2>/dev/null | tee -a... (4 Replies)
Discussion started by: newbie_01
4 Replies
USERMGMT.CONF(5)					      BSD File Formats Manual						  USERMGMT.CONF(5)

NAME
usermgmt.conf -- user management tools configuration file SYNOPSIS
usermgmt.conf DESCRIPTION
The usermgmt.conf file defines the default values used by the user management tools, useradd(8) and friends. Options in this file can be set by manually editing /etc/usermgmt.conf or using the -D option to useradd(8). base_dir sets the base directory name, in which new users' home directories are created when using the -m option to useradd(8). class sets the default login class for new users. See login.conf(5) for more information on user login classes. expire sets the default time at which the current password expires. This can be used to implement password aging. Both the expire and inactive fields should be entered in the form ``month day year'', where month is the month name (the first three characters are sufficient), day is the day of the month, and year is the year. Time in seconds since the epoch (UTC) is also valid. A value of 0 can be used to disable this feature. group sets the default primary group for new users. If this is '=uid', then a uid and gid will be picked which are both unique and the same, and a line will be added to /etc/group to describe the new group. It has the format: group gid | name | =uid homeperm sets the default permissions of the newly created home directory if -m is given to useradd(8). The permission is specified as an octal number, with or without a leading zero. inactive sets the default time at which new accounts expire. A value of 0 can be used to disable this feature. Also see the expire field. password specifies an already-encrypted default password. preserve If this value is one of 'true', 'yes', or a non-zero number, then the user login information will be preserved when removing a user with userdel(8). range specifies the uid boundaries for new users. If unspecified, the default is ``1000..60000''. It has the format: range starting-uid..ending-uid gid_range specifies the gid boundaries for new groups. If unspecified, the default is ``1000..60000''. It has the format: gid_range starting-gid..ending-gid shell sets the default login shell for new users. skel_dir sets the default skeleton directory in which to find files with which to populate the new user's home directory. FILES
/etc/usermgmt.conf /etc/skel/* /etc/login.conf SEE ALSO
login.conf(5), passwd(5), user(8), useradd(8), userdel(8), usermod(8) HISTORY
The usermgmt.conf configuration file first appeared in NetBSD 1.5. BSD
December 31, 2009 BSD
All times are GMT -4. The time now is 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy