0
votes
0answers
51 views

Get file created by a program launched by a bash script

I have the next scripts: | base_dir/ | - test.sh | | tests/ | | - elaborato.sh test.sh run elaborato.sh elaborato.sh could create a file (not always it create a file). I need : to know the ...
0
votes
2answers
30 views

Keep backing up (copying) the same file to a new folder

I am saving a stream in my HDD. I'd like to copy the file periodically into a subfolder backup such that the older versions of the the file are not deleted. Simply put Assume the original file is ...
1
vote
0answers
22 views

Detect file size decrease

I am saving streams from browser cache into my home folder. I wrote a script that takes the specific data type and saves them into disk, and names them as data.1, data.2 , data.3 and so on, creating ...
1
vote
2answers
224 views

Move images from sub-folders into new sub-folders

I have a folder composed of M several sub-folders, each of them containing some text files and N images (*.png) This is what the tree looks like: /parent/ /sub-folder1/ /data1.dat /data2.dat ...
0
votes
1answer
28 views

Rename new files as the old ones

I have a large music collection, and a good number of playlists that I have formed over the years. All the music is neatly organised in a folder hierarchy. I have managed to get my hands on higher ...
1
vote
5answers
214 views

Hide multiple files at once with shell script

I'm trying to hide some files with some command, I tried the rm command, but it did not work and also tried to rename but did not understand how it works. The files that I want to hide have spaces in ...
0
votes
1answer
163 views

Cant create a file and write to it from a .sh script

I am trying to create a file and write to it using a .sh script but is not working(Nothing is being created, and I don't see any error). This is how that part of my script looks like: ...
2
votes
1answer
168 views

How to monitor a local file for changes, apply a RegEx replace on it and save/overwrite to a destination file?

I'd like to start a script or something that watches a text file for changes. When the file changes I want to run it through a RegEx parser to replace some text and then output the modified file to a ...
2
votes
1answer
121 views

What is the best directory for script files?

I have my own shell script files and I want to run them in terminal, keeping them in /usr/bin folder. But my question is: which directory is best for keeping files of my own script? I want to use this ...
0
votes
2answers
225 views

Linux Batch File Similar to Windows Batch File (for backing up a database)

I have here the batch file in windows, I want to apply the same to linux. May I ask your help to run it in linux. Below is the batch file for windows: @echo off TITLE Upload Masterlist set /p ...
11
votes
2answers
933 views

How can I programmatically change a file's icon?

If I select an icon in Nautilus and select Properties, I can click on the icon presented there. This gives me a file-chooser dialog to select a new icon image. I would like to do this via a script of ...
0
votes
1answer
217 views

How can I make this evhz.c file to run properly?

I'm really new at linux. I just installed Ubuntu 12.04- I compiled and tried to run a program but it doesn't work and I don't have a clue why. searched on google but no one seems to have a problem ...
0
votes
1answer
325 views

How to copy files of an extension, only if the same file exist in the destination?

It may sound strange, but I really want to copy only the existing files, so this files will be updated/overridden, and any new file will not be added. I want to copy files of a single extension. It ...
2
votes
2answers
73 views

How to push specific bits into a new file?

Is there any way for me to push specific bits into a new file, without creating temporary files and then concatenating them? For example, I want to create a 10 octets file, where the first three are ...
1
vote
1answer
1k views

What command can delete folders older than X days or X months?

I know a command to do the same with files, but what about folders (and all the files in it of course)?
6
votes
1answer
625 views

How can I make a script to place files older than each day before into their own folder?

I'm running an unnecessarily complex script which looks similar to this command: find /home/user/videos/*.avi -mtime +0 -exec mv -f {} "/home/nb/videos/1 day old" \; And then I run the same ...
1
vote
1answer
498 views

How detect and run a shell script when any file or folder is being copied/moved to a directory?

How can I detect any file or folder is being copied/moved to a directory and then run a shell script? The files copied/moved would mostly have the same file names as the existing ones...
2
votes
4answers
396 views

Reorder Files inside Folder

I have about 30K songs in mp3. I already organized/tagged them with Musicbrainz Picard. But Picard made an excess of folders and subfolders inside each other because of the tags. What I need now is a ...
2
votes
5answers
2k views

Need some help creating a script to rename text files and move them to a directory

I have recently managed to convince my mother to let me switch her PC to Ubuntu, and to make her transition easier I want to automate as many tasks as possible for her. I managed to do quite a bit, ...