04-20-2013
You line of code has problems. If there are odd characters in file names ex:spaces tabs or '\n' it will screw up the result of find and cause your mv to interpret /dump as the name to use as a destination file name.
Have a look here:
ParsingLs - Greg's Wiki
Last edited by jim mcnamara; 04-21-2013 at 08:55 PM..
This User Gave Thanks to jim mcnamara For This Post:
9 More Discussions You Might Find Interesting
1. Windows & DOS: Issues & Discussions
:D mount -t vfat /dev/hda1 /mnt
my dillemma is simple i have psion 5 mx wich is an epoc type machine not only does it only work on windows as far as I know but I have to convert the files (the usual stuff!) sometimes a humen error happens and the files that I want to transfer to the linux drive... (7 Replies)
Discussion started by: moxxx68
7 Replies
2. HP-UX
Hi All
I want to plan my backups, but 1st i would like to know what is the size of each directory. Is there any command which can show me the size of directories?
Regards (2 Replies)
Discussion started by: cgege
2 Replies
3. UNIX for Dummies Questions & Answers
$ls -lrt mydir
total 12
drwxrwxrwx 2 nobody nobody 512 Aug 8 11:51 tmp
drwxrwxrwx 2 nobody nobody 4608 Jan 19 12:20 web.cache
$ ls -lrt mydir/web.cache/
total 0
$ ls -lrt mydir/tmp/
total 0
Can anyone explain me the above results? I know the o/p of ls, but this... (3 Replies)
Discussion started by: rahulrathod
3 Replies
4. Shell Programming and Scripting
Hi,
I have one file stat.
Stat file contents are as follows: for example.
H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000
H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000
Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies
5. Shell Programming and Scripting
hai,
i am new to unix scripting & learning unix scripting and doing some assignments....
i have an assignment as follows,
i want to check the size of the text file and .ext files in all directories,
if any one of them is greater than 100mb , i have to display those files..
... (2 Replies)
Discussion started by: G.K.K
2 Replies
6. Shell Programming and Scripting
Hi ,
I am very new to unix as well as shell scripting. I have to write a script for the following requirement.
In a particular mount, have to list all the directories and sub directories along with size of the directory and sub directory in ascending order.
Please help me in this regard and many... (4 Replies)
Discussion started by: nmakkena
4 Replies
7. UNIX for Dummies Questions & Answers
Alright so I've tried a couple different things that at first glance, looked like they worked.
find . -maxdepth 5 -type d -daystart -mtime 1 | xargs du -h Which seems to ignore the previous commands such as depth and modified time.
find .. -maxdepth 2 -type d -daystart -ctime 1 | xargs... (8 Replies)
Discussion started by: Aussiemick
8 Replies
8. Shell Programming and Scripting
Hi guys,
i'm searching for a command, which gives me back all the directories which are greater than a particular size?
thx for helping so far :b:
guti (2 Replies)
Discussion started by: guti_rocks
2 Replies
9. Shell Programming and Scripting
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies
du(1) General Commands Manual du(1)
NAME
du - summarize disk usage
SYNOPSIS
type] [name]...
DESCRIPTION
The command gives the number of 512-byte blocks allocated for all files and (recursively) directories within each directory and file speci-
fied by the name operands. The block count includes the indirect blocks of the file. A file with two or more links is counted only once.
If name is missing, the current working directory is used.
By default, generates an entry only for the name operands and each directory contained within those hierarchies.
By default, when a symbolic link is encountered on the command line or in the file hierarchy, will count the size of the symbolic link
rather than the file referenced by the link, and will not follow the link to another portion of the file hierarchy.
Options
The command recognizes the following options:
Print entries for each file encountered
in the directory hierarchies in addition to the normal output.
For each name operand that is a directory for which file system swap has been enabled, print the number of blocks the swap
system is currently using.
If a symbolic link is specified on the command line,
will count the size of the file or file hierarchy referenced by the link. Unlike the option, it will not follow sym-
bolic links encountered during the traversal of the directory hierarchy.
Gives the block count in 1024-byte blocks.
If a symbolic link is specified on the command line or
encountered during the traversal of a file hierarchy, will count the size of the file or file hierarchy referenced by
the link.
Print messages about directories that cannot be read,
files that cannot be accessed, and so on. is normally silent about such conditions.
Print only the grand total of disk usage
for each of the specified name operands.
Restrict reporting to file systems of the specified
type. (Example values for type are and so on.) Multiple options can be specified. Disk usage is normally reported
for the entire directory hierarchy below each of the given name operands.
Restrict reporting to only those files
that have the same device as the file specified by the name operand. Disk usage is normally reported for the entire
directory hierarchy below each of the given name operands.
According to the standards, specifying more than one of the mutually-exclusive options and will not be considered an error. The last
option specified will determine the behavior of the utility.
EXAMPLES
Display disk usage for the current working directory and all directories below it, generating error messages for unreadable directories:
Display disk usage for the entire file system except for any or mounted file systems:
Display disk usage for files on the root volume only. No usage statistics are collected for any other mounted file systems:
WARNINGS
Block counts are incorrect for files that contain holes.
SEE ALSO
df(1M), bdf(1M), quot(1M), standards(5).
STANDARDS CONFORMANCE
du(1)