I have the small script to arrange files of a descending way.
i wanted for example if I place -d one arranges only the folders or -a to arranges only the files.
Cheers
Last edited by Scott; 11-24-2010 at 02:40 AM..
Reason: Code tags
You should move past calling "sh scriptname args" to putting a first line of "$#/bin/sh" (or wherever) in your script and "chmod u+x scriptname". See man 2 exec. Then, you just call "scriptname args".
You might move on to ksh, too, as sh has real limitations and ksh offers a proper superset of the sh commands and such. ksh93 is free. ubuntu should come with at least pdksh, which is not the real deal but better than sh!
If a script says "'ls' is not known", it is saying your $PATH is not exported so it could not find it in /usr/bin/ls or /bin/ls or wherever. Just setting an variable only affects it in the memory of the current instance of sh. In sh you must:
but in ksh you can say it more cleanly:
A directory can have thing other than files and dirs in it, like devices, symbolic links and named pipes, so my code does dirs or everything else.
i have changed script
I can to see the files for descending size /miscript.sh /root for example.
How i can to place at the end of the command, if I place -d one arranges only the folders or -a to arranges only the files.
Last edited by Scott; 11-24-2010 at 06:21 PM..
Reason: Code tags
Hi,
So i know we use cp -r as a basic to copy folders/files.
I would like this BUT i would like to show the output of the files being copied.
With the amazing knowledge i have i have gone as far as this:
1) find source/* -exec cp -r {} target/ \;
2) for ObjectToBeCopied in `find... (6 Replies)
I am trying to cat 3 files. They all have the same name MFExtract.txt. But, they are in 3 seperate file names. Any idea how I could cat the 3 together. It's throwing me off figuring out a way because the names are the same. I was thinking just doing a 3 cat commands with the full path names and... (2 Replies)
is there any command that can make listing files like this
/data/seismic/prestack-4/eon5/PEP/JAWA/AKASIA-BAGUS/3D/F/BL3-4/F12AKB3D_SW82-128_ID1696-1850.segy
/data/seismic/prestack-4/eon5/PEP/JAWA/AKASIA-BAGUS/3D/F/BL3-4/F12AKB3D_SW82-128_ID1851-1975.segy ... (2 Replies)
Hi,
I need a script/command to list out all the files in current path and also the files in folder and subfolders.
Ex: My files are like below
$ ls -lrt
total 8
-rw-r--r-- 1 abc users 419 May 25 10:27 abcd.xml
drwxr-xr-x 3 abc users 4096 May 25 10:28 TEST
$
Under TEST, there are... (2 Replies)
Hello again,
A little while back I got help with creating a command to search all directories and sub directories for files from daystart of day x.
I'm wondering if there is a command that I've overlooked that may be able to search for / write folder names to an output file which ideally... (2 Replies)
Hi, all:
I've got two folders, say, "folder1" and "folder2".
Under each, there are thousands of files.
It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command.
However, if I change the above question a... (1 Reply)
Hello Unix gurus,
I am new to Unix. I am working on some dummy project which involves unix scripting.
I have a query :
There is a file Number.dat which is of form say
AAA|123|4563|animal
AAA|1234|45634|animal2
BBB|123444|456312|bird
BBB|123445|456313|bird2
Here AAA,BBB are... (29 Replies)
Hi,
I had a directory and many subdirectories and files with in it.
Now i want to get the timestamp of files from the files and folders recursively. :(
Please help me to generate a script fort he above mentioned requirement!
Appreciate for ur qick response
Thanks in advance!
... (2 Replies)
Dear all,
I want to remove files older than 2 months in the /home/member directory. But except the configuration files (like .bash_profile .config/ .openoffice/ .local/ .kde/ etc..)
I have tried with the command
find . -mtime +60 -wholename './.*' -prune -o -print -exec mv {} \;
but it... (1 Reply)