find

Using find to locate files modified within yesterday

限于喜欢 提交于 2021-01-20 12:07:15
问题 I would like to get a shell command to find the files with a modification date for yesterday — 24 hours only. That means I would like to find the files which were modified yesterday only. 回答1: Use find with mtime and daystart , it will find files modified 1*24 hours ago, starting calculations from midnight (daystart): find dir -daystart -mtime 1 回答2: This answer assumes you have GNU date and find. It also assumes that if you run the script at any time on 2016-07-14, you want the files

Using find to locate files modified within yesterday

扶醉桌前 提交于 2021-01-20 12:06:56
问题 I would like to get a shell command to find the files with a modification date for yesterday — 24 hours only. That means I would like to find the files which were modified yesterday only. 回答1: Use find with mtime and daystart , it will find files modified 1*24 hours ago, starting calculations from midnight (daystart): find dir -daystart -mtime 1 回答2: This answer assumes you have GNU date and find. It also assumes that if you run the script at any time on 2016-07-14, you want the files

find command in bash script resulting in “No such file or directory” error only for directories?

不问归期 提交于 2021-01-17 07:49:44
问题 UPDATE 2014-03-21 So I realized I wasn't as efficient as I could be, as all the disks that I needed to "scrub" were under /media and named " disk1 , disk2 , disk3 , etc." Here's the final script: DIRTY_DIR="/media/disk*" find $DIRTY_DIR -depth -type d -name .AppleDouble -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDB -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDesktop -exec rm -rf {} \; find $DIRTY_DIR -type f -name ".*DS_Store" -exec rm -f {} \; find $DIRTY

find command in bash script resulting in “No such file or directory” error only for directories?

橙三吉。 提交于 2021-01-17 07:47:25
问题 UPDATE 2014-03-21 So I realized I wasn't as efficient as I could be, as all the disks that I needed to "scrub" were under /media and named " disk1 , disk2 , disk3 , etc." Here's the final script: DIRTY_DIR="/media/disk*" find $DIRTY_DIR -depth -type d -name .AppleDouble -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDB -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDesktop -exec rm -rf {} \; find $DIRTY_DIR -type f -name ".*DS_Store" -exec rm -f {} \; find $DIRTY

find command in bash script resulting in “No such file or directory” error only for directories?

只愿长相守 提交于 2021-01-17 07:46:32
问题 UPDATE 2014-03-21 So I realized I wasn't as efficient as I could be, as all the disks that I needed to "scrub" were under /media and named " disk1 , disk2 , disk3 , etc." Here's the final script: DIRTY_DIR="/media/disk*" find $DIRTY_DIR -depth -type d -name .AppleDouble -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDB -exec rm -rf {} \; find $DIRTY_DIR -depth -type d -name .AppleDesktop -exec rm -rf {} \; find $DIRTY_DIR -type f -name ".*DS_Store" -exec rm -f {} \; find $DIRTY

Linux find命令的使用方法

跟風遠走 提交于 2021-01-06 15:50:45
find 命令的使用格式: find [options][查找路径][查找条件][处理动作] 查找条件: -name:指按文件名称进行查找 -iname:查找文件时不区分大小写 -user:根据文件的属主进行查找 -group:根据文件的属组进行查找 -uid:根据文件的UID号进行查找 -gid:根据文件的GID号进行查找 -nouser:查找没有属主的文件 -nougrou:查找没有属组的文件 -type : 根据文件类型查找 -type f:查找文件类型是普通文件的类型 -type d:查找文件类型是目录的文件 -type b:查找文件类型是块设备的文件 -type c:查找文件类型是字符设备的文件 -type l:查找文件类型是符号链接的文件 -type p:查找文件类型是命名管道的文件 -type s:查找文件类型是套接字的文件 -size:根据文件的大小进行查找常用的单位有K,M,G -size -2M:指查找小于2兆的文件,1兆到2兆之间的 -size +2m:指查找大于2兆的文件,2兆到3兆之间的 -amin -n 在最近的 n 分钟内被读取过 -amin +n : 在 n 分钟之前被读取过 -atime -n : 在最近的 n 天内读取过的档案 -atime +n : 在 n 天前读取过的档案 -cmin -n : 在最近的 n 分钟内被修改过 -cmin +n

Linux find command permission denied

╄→гoц情女王★ 提交于 2021-01-04 07:14:34
问题 I want to filter out the unnecessary information "Permission denied". these are outputs from command " find -type f -name sources.list " find: './run/lxcfs': Permission denied find: './run/sudo': Permission denied find: './run/lvm': Permission denied find: './tmp/systemd-private-99eef94819d84080adc7df3e60efee5b-systemd-timesyncd.service-HE48k9': Permission denied find: './lost+found': Permission denied find: './dev/vboxusb': Permission denied find: './root': Permission denied ./etc/apt

Linux find command permission denied

江枫思渺然 提交于 2021-01-04 07:12:37
问题 I want to filter out the unnecessary information "Permission denied". these are outputs from command " find -type f -name sources.list " find: './run/lxcfs': Permission denied find: './run/sudo': Permission denied find: './run/lvm': Permission denied find: './tmp/systemd-private-99eef94819d84080adc7df3e60efee5b-systemd-timesyncd.service-HE48k9': Permission denied find: './lost+found': Permission denied find: './dev/vboxusb': Permission denied find: './root': Permission denied ./etc/apt

Find abrupt slopes in data

二次信任 提交于 2021-01-04 06:36:52
问题 I have a high-resolution vertical profile of a pavement surface with X and Y coordinates and I'm looking for abrupt increases in Y which could be attributed to a trip hazard (classed as a 6 mm increase). I'm using the findpeaks command in pracma but it's not doing what I want (or I'm not using it properly). What I need to do is detect increases in Y of at least 6 mm over a specified distance of X, let's say 100 mm for this example, and to record the maximum value of Y over the increase.

Create symbolic link from find

大兔子大兔子 提交于 2020-12-28 07:51:35
问题 I'm trying to create a symbolic link (soft link) from the results of a find command. I'm using sed to remove the ./ that precedes the file name. I'm doing this so I can paste the file name to the end of the path where the link will be saved. I'm working on this with Ubuntu Server 8.04. I learned from this post, which is kind of the solution to my problem but not quite- How do I selectively create symbolic links to specific files in another directory in LINUX? The resulting file name didn't