I have a large directory of music files that is often changing as files and directories come and go.
Sorry, I know this must have been asked before but I couldn't find it...
Is there a command to remove all files and subdirectories in a directory WITHOUT deleting the directory?
For example if I have directory "dontDeleteMe" with subdirectories "1", "2", "3" and each subdirectory has a few pictures in it, how can I remove the subdirectories "1", "2", and "3" and all the files in the them, withou
I'm running zsh on Linux under setopt extended_glob ksh_glob glob_dots. I'm looking for something easy to type on the command line, with no portability requirements. I'm looking at a source code tree, with no “weird” file names (e.g.
how can i make find/sed to include directory names with spaces
the command is like this
Code:
for i in `find wp-content/themes -type f -print0 | xargs -0 grep -l
-iE 'e'`;do sed -i -e 's/word1/word2/gI' "$i";done
but it skips one directory names with spaces
Code:
sed: can't read ./Nova: No such file or directory
sed: can't read pasta/font/bougan_black_ssi_bold-webfont
there was a post previously about this from around 2010
but i was unable to get the suggested scripts there to work.
the following code works for me when it's saved inside the
directory of files whose names i want to shorten, but i would
like to be able to store it in a file with a list of
directories and have it enter into each directory, shorten the
file names in that directory, and t
Add a string to a text file from terminal
I've been looking at this thread. The solution (number 2, with ls | grep) works perfectly for files called .txt in the current directory.
Hi,
We have a shell script which looks into a directroy for any folder older than 30 days and removes them.
I thought the flags I mentioned in the question are the same, but I get the following message with the former, but nothing with the latter:
$ find .
How to make recoll list only folder or directory names instead of files?
Or how to filter category to only search for directory names not directory
contents (files)? Many times, I can only remember the folder's name not
the file names. Thank you for your help.