Sponsored Content
Full Discussion: Is `mv dir dir2` atomic ?
Top Forums UNIX for Dummies Questions & Answers Is `mv dir dir2` atomic ? Post 302170823 by meili100 on Tuesday 26th of February 2008 09:18:12 PM
Old 02-26-2008
Is `mv dir dir2` atomic ?

if I rename a dir
mv dir dir2

Is this operation atomic? Suppose there 100 files in dir, does linux rename them one by one or at once?

In other words, is there a time at which both dir and dir2 exist, with dir has, say 30 files and dir2 has the rest 70 files?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

2. Programming

Atomic lock file creation

Hello, I need to implement a locking system in C. My problem is how to make the check if the lock file exist and locking it atomic operation. I want to make something like this: FILE* lock_fname; lock_fname = fopen ( "file.lock", "r"); /*check if file exsists*/ if (lock_fname) { fclose... (7 Replies)
Discussion started by: tsurko
7 Replies

3. UNIX and Linux Applications

CPIO Problem, copy to the root dir / instead of current dir

HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file! I tried all these commands cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies

4. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

5. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

6. UNIX for Dummies Questions & Answers

system calls and atomic operation

Are system calls atomic operations? Is a system call can be interrupted? (2 Replies)
Discussion started by: vistastar
2 Replies

7. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

8. Linux

Atomic Operations

Hello I am a newbie in linux. Please tell me what are atomic operations in Linux. IS i++ a atomic oparation?? Please help.. (3 Replies)
Discussion started by: aditya08
3 Replies

9. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies
SLOCATE(1)						      General Commands Manual							SLOCATE(1)

NAME
slocate - Security Enhanced version of the GNU Locate SYNOPSIS
slocate [-qi] [-d <path>] [--database=<path>] <search string> slocate [-i] [-r <regexp>] [--regexp=<regexp>] slocate [-qv] [-o <file>] [--output=<file>] slocate [-e <dir1,dir2,...>] [-f <fstype1,...>] <[-l <level>] [-c] <[-U <path>] [-u]> slocate [-Vh] [--version] [--help] DESCRIPTION
Secure Locate provides a secure way to index and quickly search for files on your system. It uses incremental encoding just like GNU locate to compress its database to make searching faster, but it will also store file permissions and ownership so that users will not see files they do not have access to. This manual page documents the GNU version of slocate. slocate Enables system users to search entire filesystems without displaying unauthorized files. OPTIONS -u Create slocate database starting at path /. -U <dir> Create slocate database starting at path <dir>. -e <dir1,dir2,...> Exclude directories from the slocate database. -f <fstype1,...> Exclude files on specific file systems from the slocate database. -c Parse '/etc/updatedb.conf' when updating the slocate database. -l <level> Security level. 0 turns security checks off. This will make searchs faster. 1 turns security checks on. This is the default. -i Does a case insensitive search. -q Quiet mode. Error messages are suppressed. -n <num> Limit the amount of results shown to <num>. -r <regexp> --regexp=<regexp> Search the database using a basic POSIX regular expression. -o <file> --output=<file> Specifies the database to create. -d <path> --database=<path> Specifies the path of databases to search in. -h --help Display this help. -v --verbose Verbose mode. Display files when creating database. -V --version Display version. VERSION
Secure Locate v2.6 AUTHOR
Kevin Lindsay - Copyright (c) 1999, 2000 BUG REPORT
Report any bugs to klindsay@mkintraweb.com FTP
ftp://ftp.geekreview.org/slocate/ ftp://ftp.mkintraweb.com/pub/linux/slocate/ WEB
http://www.geekreview.org/slocate/ SLOCATE(1)
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy