Ubuntu :: Create Loop Which Is Contingent On Amount Of Files In Folder

Dec 25, 2010

I've read the documentation but can't figure it out. Let's say that I want to write a shell script which will rename every .jpg file in a folder to prepend "Linux_" to it.Challenge #1: how do I create a loop which is contingent on the amount of files in that folder Challenge #2: how do I know that file's respective name? I think it should look like this:

Loop /home/administrator/Images/*.jpg
(
Mv THATFILENAME Linux_THATFILENAME
)

View 9 Replies


ADVERTISEMENT

Ubuntu :: Create A Folder Where You Can Copy Files To But You Can't Delete Them After?

Nov 24, 2010

i'm confronting atm. I need to create a folder where ppl can copy files and i need to be sure that those files cannot be deleted after they are copied there. The folder will be accessed over network, and i need to be sure no one will delete somebody else's files.Also i need to tell you that i'm working with regular users, so creating a folder for each user and chown/chmod-ing it won't do the trick(allready tried and ended up with a whole lot of files in the parent directory).I also tried chattr +a but that doesn't allow them to write new files in the folder.

View 2 Replies View Related

Ubuntu :: Can't Create New Folder In System Files (not Even In Terminal)?

Mar 17, 2011

I don't seem to be able to create a new folder in my system files. I know I have to do this in the terminal as root, but I always get the answer that it cannot create the directory because there is no such file or directory. Yet the directory where I want to make the new folder definitely exists (I even just go there and try to create the folder)Here is the exact code:Code:lukas@lukas-VGN-FZ21E:/proc/asound/card0/pcm0p$ sudo mkdir ossmkdir: cannot create directory `oss': No such file or directory

View 4 Replies View Related

General :: File Permission - User Can Create Files/folders In The Shared Folder

May 4, 2011

Is possible to make a folder permission like below?

-User can create files/folders in the shared folder.

-But the files/folders they created, cannot be delete/change by em.
(only can be delete by root users)

-Each new files/folders created will auto owner to root only.

View 4 Replies View Related

Ubuntu Security :: Configure The Share And Folder So That The Win7 Client Can Create Files And/or Folders In The Share?

Jan 15, 2010

I've just installed Ubuntu 9.10 and Samba 3.4. I've shared a folder and have accessed the share from a Windows 7 client. However, I've struggled to configure the share and folder so that the Win7 client can create files and/or folders in the share. Kept getting Permission Denied errors. Finally, (using Webmin) I set the permissions on the file folder so that "Other" had write access. I don't understand why this was necessary (and how unsecure this is). I already had the write access checkbox ticked for "User" but it wasn't enough.

View 1 Replies View Related

General :: Get Output Of Text File Containing Account Number, Debit Amount, Credit Amount,date Using Shell Script?

Apr 9, 2011

How to get output of text file containing account number, debit amount, credit amount,date using shell script?

View 1 Replies View Related

Ubuntu :: Moving A Huge Amount Of Files?

Jul 27, 2011

i have about 2 TB of 700mb avi files as data on disc want to spread it across two 2TB ext usb drives (sata 3.5 inside the housing) obviously i have to rip them to the laptop and then move to the ext hdd (omg laborious little task) am i better doing the ripping in meerkat or in a windows machine? files need to be accessible by W7, XP, and meerkat to vlc player. what should i format the discs to?

View 5 Replies View Related

Ubuntu :: Create Folder',and Results In An Empty Folder Being Created On Desktop?

Oct 29, 2010

I have this nasty habit of refreshing desktop in a quick succession by right-clicking and selecting 'Refresh',on my XP system at office.(And,iam sure most of us do the same).With Ubuntu,if a right-click on desktop slowly and select 'align by...',it simulates the XP refresh action as explained above.But,if i perform the same action rapidly,it takes this first option from right-click context menu,which is 'Create Folder',and results in an empty folder being created on desktop.I tried double right-clicking and again it created an empty folder.Is there any workaround to handle this.I mean:Can the right-click context menu items be shuffled so that the 'Create Folder' option is moved from 1st place

View 9 Replies View Related

General :: Loop Pictures From A Folder And Display Fullscreen Slideshow?

Nov 16, 2010

Need a Linux solution for looped slideshow from pictures in some folder. Pictures may be deleted and added, so it's a bonus if it doesn't stop/crash if currently shown picture is deleted.

View 3 Replies View Related

Ubuntu Security :: Opt Folder Doesn't Allow To Create Folder

Oct 28, 2010

I'm new to ubuntu and want to install stepmania so i downloaded the binary, i want to put the files in the /opt/ directory, the only problem is i cant create a new folder, i tried dragging a ready-made file into it but it just says "you do not have the permissions to file:///opt/" Im soo sad i wanna play my sM NOW!

View 3 Replies View Related

Ubuntu :: Determined That A Huge Amount Of Disk Space Is Being Taken Up By Files In /var/log/?

May 18, 2010

I examined the problem, and determined that a huge amount of disk space is being taken up by files in /var/log/ The following files:

Code:
/var/log/messages.1
/var/log/kern.log.1
/var/log/daemon.log.1
/var/log/messages
/var/log/kern.log
/var/log/daemon.log
/var/log/syslog

are all over 1 GB in size. The largest is 18 GB. Together, they total 48.3 GB. I restarted the system, forcing a fsck.

View 3 Replies View Related

Debian :: Create Folder From Filename And Move File Into Folder

Feb 13, 2011

this is posable but am trying to do this "Create folder from a filename and move the file into the folder" i have 500000+ file's i need to do with is there a easy way?I really don't want to download them all make/move them with filemonkey just to re-upload them

View 2 Replies View Related

Ubuntu :: Best And Full Feature Editor - Open All Files In A Folder When Drag And Drop The Folder On It

Jun 21, 2011

when i used windows there was this wonderful editor named Notepad++.it was perfect(it still is) some of its best and useful features of it (for me) was:

1-open all files in a folder when drag and drop the folder on it
2-search and replace a statement in all open files
3-have an extended mode which include special characters like

and so on.. i want to know if there is an editor with this feature in ubuntu?

View 8 Replies View Related

Ubuntu :: Copy Files From Original Folder To $user Folder?

Oct 22, 2010

i want make a bash panel and i want he will copy files from orginal folder to $user folder i mean when for explame i type i want install some server he say cp: cannot stat 'root/Desktop/2/files/beckup/sa-mp-steam': No such file or directory.

View 6 Replies View Related

General :: Loop Through A DIR To Delete Files By Inode

Feb 9, 2010

I have a directory that contains some files (over a 1,000) that have a '' in the filename. There are also some good files that I need to keep. therefore I need a script to delete based on inode.

What I have thus far:
list="$(ls -il /opt/PC/log/*RPOUT*.xml)" #this gives me the list
# I need to get the inode of.
for i in $list
do
find . -inum $i -exec rm -i {} ;
echo "delete file" $i >> /home/me/tmp/del_inode.txt
done
echo 'completed'

I know this is not right ... what I know is is the 'find' is. I need to loop through the $list gleaning inodes to get all the files with '' delete. I'm not sure how. The $i gives me the whole line. I just want the first position. set $() does not seem to work ...

View 5 Replies View Related

Ubuntu :: Accessing And Creating Files Names With Nested Loop In Bash?

Aug 12, 2011

nested loop in ''Bash-Scripting in Linux'' ?What's wrong with my code:

for x in `seq 0.75 0.01 0.95`
do
for y in `seq 0.20 0.01 0.40`

[code]....

View 1 Replies View Related

General :: List Folder Size And Number Of Files And Folders In Folder?

Nov 23, 2010

In Linux bash shell, for a given directory, how can I list:The create date for that directory The number of files in that directory The number of subdirectories in that directory.

View 3 Replies View Related

General :: Shell - Shellscript Combine All Files Without For Loop?

Jun 12, 2011

I have hundreds of files in one directory, is there a simple command or pipes of command I can use to append them together? I don't want to use any loops.

View 4 Replies View Related

Programming :: BASH : Using A Loop To Download A Series Of Files?

Feb 2, 2010

Never mind, I figured it out myself. Firstly, the old version of BASH I'm using doesn't support

Code:

for i in {1..27}

So I had to use

Code:

for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

Secondly, it was simply

Code:

#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
do

[code]....

View 2 Replies View Related

Programming :: Generating Files With Different Names At Each Loop In Fortran?

Nov 7, 2010

I am trying to write a loop to open four main-data-files. At each open of the main-data-file, I want the loop to open another four sub-files and split the data from the mail-data-file according to the creteria and dump into the four files. When the loop goes to the second main-data-file, it shall generate another 4 sub-files with different file name. And the process goes on. That means I will have total of 16 sub files for the four main-data-files. Each four files from the 16 files shall have specific name on it. Based on the code which I given below, I would say when the file at UNIT=100 is opened, 4 new files needed to be opened as well. They are:

maximum_dist_001_064.dat
maximum_dist_065_128.dat
maximum_dist_129_192.dat
maximum_dist_193_256.dat

View 1 Replies View Related

General :: Copying All .jpg Or .JPG Files From A Folder And All Its Subfolders To /usr/name/pictures Folder?

Sep 10, 2009

How would i go about copying all .jpg or .JPG files from a folder and all its subfolders to my /usr/name/pictures folder? I'm guessing I'd have to use some sort of .[jJ][pP][gG] to get all the pictures from other examples i've seen, but really not sure how to use that in a recursive cp.

View 14 Replies View Related

General :: For Loop Or While Loop To Read The Fields Of A File?

Sep 1, 2010

I have a mytext file with month and year as two separate fields. likemytext fil

08 2010
09 2010
10 2010
........
........
........

I want to read the values of each field i.e., month and year into an awk script.

View 10 Replies View Related

General :: Create A New Background Process In A KSH "while Read" Loop?

Jun 20, 2010

When I add the line (sleep 5 ) & in the script then the "while read" loop does not read all lines from the file, but only prints the first line.But when I remove the ( sleep 5 ) & from the script, then the script prints all lines as defined in the file.And how to solve the problem? I want to create a new process (for which the sleep is just an example) in the while loop:

$ more test
#!/bin/ksh
while read -r line ; do

[code]....

View 1 Replies View Related

CentOS 5 Server :: NFS Mount Of Loop Mounted ISO's Showing No Files

Jul 16, 2009

I'm having a problem accessing files via nfs where an iso has been mounted through the loop device on the nfs server. Basically what I am attempting to do is access the 6 CentOS 5.2 ISO's via NFS from one of my client machines. The client is able to mount the share and see its sub directories leading up to the mount point of the ISO, but the contents of the mounted ISO image are simply not visible (on the client, they are visible on the server).

Server config (CentOS 5):

/etc/fstab:
/home/user/iso/CentOS-5.2-x86_64-bin-1of7.iso /exportiso/centos/x64/5.2/disc1 iso9660 defaults,loop 0 0

[code].....

NFS is working correctly for other mounts between these two boxes, however.

View 1 Replies View Related

General :: Copy Files From One Folder To Another Folder Using Shell?

Mar 4, 2010

i need to copy files from a folder called output files to another folder called running but im not able to do it i always get a stat error

View 14 Replies View Related

General :: Making Specific Script Loop Over Multiple Files In Directory?

May 10, 2011

I am trying - to no avail - to take an old script I found in the forum help-needed-in-grep-for-tar-gz-658730/ The code:

Code:
#!/bin/bash
if zgrep $1 $2 > /dev/null 2>&1

[code]....

View 3 Replies View Related

General :: Keep Chmod On Folder / Sub-folder And Files?

Nov 3, 2010

I got a folder that I transfer stuff to all the time. the folder is in chmod 775 but when i upload folders and files, they are given chmod 700, but i want it chmod 775 everytime i upload something. so far i have logged in to my linux computer and did a chmod -R 775 to the folder every time i uploaded something to it. is there a function somewhere to make it 775 everytime i upload or can i have something run a script, so i don't have to go in and write it everytime i upload something?

View 2 Replies View Related

Debian :: Tool For Squid Reports (not SARG) - Generate Less Amount Of Files - Optimal Is To Save Reports To The Database

May 9, 2011

I got the following task from my boss. I have to find out if there is some alternative tool for create reports from Squid except SARG. Now, we use SARG, but my boss told to me, that the main problem of SARG is, that SARG generate huge amount files, which cause problems during migration our servers. He told to me the following condition for change of current tool (SARG):

* standard package of Debian
* generate less amount of files, optimal is to save reports to the database

So I would like to ask you if you know about some tool (I can not find some by google)... and the best would be if you told to me some practical experiences.

View 1 Replies View Related

Ubuntu :: Can't Create Folder

Mar 30, 2010

I can't create a folder in the home directory. It seems I don't have the permissions to create a folder in my home directory. This is a new installation. I want to be able to create subfolders in my home folder. Also, I want to be able to modify configuration files in the etc folder.

View 9 Replies View Related

Ubuntu :: Cannot Create Folder In USB Drive?

Apr 20, 2010

when I try to create a folder in my USB drive I get this ..Error while creating directory untitled folder.There was an error creating the directory in /media/TRAVELDRIVE

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved