1
vote
1answer
35 views

Trim File Names of Tarballs Using Bash

I need to grade some source code from various students. The submission process is through Blackboard which appends to the file name a bunch of unnecessary stuff. Here is an example: Test ...
0
votes
1answer
70 views

How to extract the filename without the extension from a full path?

I'm trying to right my first bash script, and at one point a filename is passed to the script as $1. I need to extract the file name without the extension. Currently, I'm assuming that all extensions ...
2
votes
2answers
49 views

quotes around filenames confuse bash script

I am writing a script that applies a command to loads of files. The way I automate this boils down to #!/bin bash for in_file in ${PWD}/*/*/*.txt; do out_file="${in_file//in/out}" ...
0
votes
3answers
383 views

How to organize files in accordingly named directories from command line under Linux

I have a directory filled with various files, differently named (i.e. not named with a specific pattern) and with different extensions, and I want to put each file in a newly created subdirectory ...
0
votes
2answers
71 views

Make directories for each file placed in main directory [duplicate]

I want to place a list of files into individual directories I create from each filename. So given the files in the root directory: Movie1.avi movie2.m4v movie3.mp4 I want to mkdir Movie1, movie2, ...
0
votes
4answers
183 views

bash - directories ending in . and whitespace cannot be removed

On my external hard drive are two directories, Fun. and Complex_, where that _ is a whitespace. I cannot empty from my trash or remove them with rm -rf and I want to. Neither show up in Finder on ...
2
votes
1answer
609 views

ssh Mac Unix: copy a file with special characters and spaces

I am remote logged into a Mac and trying to copy a music file from one directory to another, but I am getting an error. I think it's caused by spaces or special characters, but not sure. the file ...
1
vote
1answer
258 views

Missing music after failed renaming with eyeD3

Most of my music is missing after I attempted to organize my music library with eyeD3. eyeD3 has a function described as thus: --rename=PATTERN Rename the file based on PATTERN which may contain ...
1
vote
2answers
543 views

Shell script for batch converting video

I'm attempting to write a script for use with HandbrakeCli to convert .mkv-files to XBOX 360 compatible mp4-files. #!/bin/bash for f in "$@" do echo "$f" HandbrakeCli -i "$f" -o ...
1
vote
1answer
1k views

how do I open a file from bash when it contains brackets

A previous developer on my project created backup copies of files using the format "filename (date time).extension" even though the project was under SVN control (don't ask!!!). I now can't open ...
2
votes
2answers
333 views

Rename sets of files based on size

Background Rename one set of files based on a name that corresponds to another set, using a sort order based on file size to match the file names. The files from both sets have approximately the same ...
2
votes
1answer
4k views

Handle filename with spaces inside Bash-script

In my Bash-script i have to handle filenames with spaces. These are the important lines inside my script: mp3file="/media/d/Music/zz_Hardcore/Sampler/Punk-O-Rama\ Vol.5\ \[MP3PRO\]/01\ -\ Nofx\ -\ ...
12
votes
4answers
8k views

Find files filtered by multiple extensions

What is the correct syntax for: find . -type f -name \*.\(shtml\|css\) This works, but is inelegant: find . -type f -name \*.shtml > f.txt && find . -type f -name \*.css >> f.txt ...
10
votes
8answers
11k views

Making BASH script `for` handle filenames with spaces (or workaround)

Whilst I have been using BASH for several years, my experience with BASH scripting is relatively limited. My code is as below. It should grab the entire directory structure from within the current ...