All Questions
14
questions
0
votes
0
answers
42
views
sanitize folder names before creation
How prevent the injection when creating folders with user supplied paths in a unix like system?
Ideally subfolders can be created only in selected or working folder. Although the creation of folder in ...
-4
votes
1
answer
93
views
Rename and replace parts with different filenames [closed]
I know there are different questions about this topic but I have found nothing that fits my question:
I want to replace a part of a name in a folder but there are different files with different names....
0
votes
2
answers
247
views
Bash directory alias/redirect
I'm trying to compile a library and his dependencies (lots of dependencies), but the system that I'm using didn't have the usual directory structure. I'm searching for a method to "redirect" all the ...
0
votes
1
answer
184
views
Bash shell copy files on the hidden directory [closed]
Need help with Unix script.
how do you use /bin/cp to copy files from /somepath/somedir/somewhere/.temp_folder
to /somepath/somedir/somewhere/
my line
/bin/cp -r somepath/somedir/somewhere/.[!.]* ...
2
votes
2
answers
2k
views
linux shell script: how to move all sub folders with a given name?
I'd like to move all sub-folders starting with a given suffix (Blah_ in the example) into an other directory using a linux bash script. Here's what the script looks like:
srcDir="/home/me/"
...
1
vote
1
answer
376
views
Replacing directories that are subversion-monitored
We're trying to update an installed software which we have under control by subversion. The update instructions for the software require replacing several directories that have .svn directories in ...
4
votes
3
answers
758
views
Prevent 'cd' remembering symbolic links traversed
Say you have directory ~/mytool that softlinks to /usr/local/mytool. Then cd mytool leaves your current directory as ~/mytool, which may cause scripts to behave incorrectly. Is there a way to avoid ...
1
vote
3
answers
3k
views
Deleting all folders older than a specified date, except some of them
i had to do a script job in bash to delete all directory in a path which are older than a specified date except some of them.
i know the name of the directories which shouldn't be deleted...
Can you ...
-1
votes
1
answer
363
views
how i can Find the files inside the folder and save the file names in variables?
how i can write bash file to Find files (number and name of files are variable) inside the folder and save the file names in variables ?
6
votes
6
answers
7k
views
Bash Script To Repair Directory and File Ownership
My client had me deploy some folders out to a bunch of home directories for his customer websites. I did this with a Bash script, but it ended up using the root account permissions.
How do I make a ...
6
votes
1
answer
969
views
how to pre-create directories on linux for file storage
looking for a way to pre-create directories on linux to be used to store a large number of files.
We will be generating file ids using a GUID - I need to keep a copy of these files on a linux web ...
9
votes
7
answers
38k
views
Check to see if a directory exists remotely (shell script)
Is there a way to see if a directory exists on a remote server?
Perhaps there's a better way, but I'm writing an application deployment script, and I want to create a directory on a remote server if ...
3
votes
3
answers
604
views
cd to a directory when its path is entered as a command (instead of "foo is a directory" error)
I hate when bash gives me "duh!" kind of error:
foo$ ./bar
-bash: ./bar: is a directory
I used to love AmigaOS shell in which "execution" of a directory simply meant setting it as the current ...
10
votes
5
answers
407
views
How do I change to the directory I just moved that file to?
So lets assume I've just done:
mv ./myfile /to/some/other/place/
And I now decide I want to follow the file, and go into that directory.
Whilst I could head for the mouse, select the text, type 'cd ...