All Questions
48
questions
0
votes
1
answer
77
views
How can I create a file named "\?$*'ChouMi'*$?\"?
I need to create a file with this exact name "\?$*'ChouMi'*$?\" so that ls would show it as:
$ ls | cat -e
"\?$*'ChouMi'*$?\"$
$
0
votes
1
answer
82
views
Linux program to quote filename only when necessary?
Consider having these directories and files:
$ tree /tmp/test
/tmp/test
├── dir
│ ├── file_normal
│ ├── file with "double quote
│ ├── file with 'single quote
│ ├── file with space
│ └── ...
1
vote
3
answers
377
views
Removing directories with spaces in their directory paths
I'm on macOS. I have many directories at paths that looks like this:
./FirstName SecondName/A Multi Word Title/Contents/Index/files
I want to remove ALL the Index directories and their contents. I ...
2
votes
2
answers
1k
views
Unzip a .zip which includes directories with spaces in Name
I have a problem with unzipping my transfered .zip file.
Firstly, I zipped a owncloud data directory with the encryption parameter. Then I transfered it to my new Server und would like to unzip it ...
0
votes
2
answers
909
views
Find not working as expected with space in directory
I have a script calling this
find "/mnt/Data/Shared/$1" -type d -exec bash -c 'fixperm "'${1}'" "fd" "$0"' {} \;
$1 is a directory, when the name contains no spaces it works, when there is a space ...
1
vote
1
answer
250
views
Command runs okay but not from bash script
Under ~/Pictures there are some sub-directories containing jpegs like
~/Pictures/Pics 1/img.jpg.
From bash:
~/Pictures $ `file Pics\ 1/img.jpg`
Output:
Pics 1/img.jpg: JPEG image data, Exif ...
3
votes
0
answers
282
views
I can see but cannot delete a file [closed]
I am running Linux Mint.I tried to copy a file with the file manager. It looked like it hung.
I can see the file in the directory with ls -l:
-rwxr-xr-x 1 mike domain^users 20 Mar 1 08:57 'output (...
6
votes
1
answer
5k
views
Why does scp's strict filename checking reject quoted last component but not others?
When I try to scp a file with a slash in its path, the path is quoted for the local host, and the last path component is additionally quoted for the remote host, like scp host:"a/b/'c'" ., it fails ...
-2
votes
2
answers
133
views
Handling whitespace in filepaths
I have this:
muh_dir=`cd $(dirname "$BASH_SOURCE") && pwd`
and yeah I tested the above (it has backticks) and it doesn't work well with whitespace in the pwd.
On the other hand, this is ...
5
votes
3
answers
9k
views
How to delete or access a file with a backslash \ in its name?
I have some files here that I copied over to this linux box using the python module pysftp:
[jm@spartan tf]$ ls -la
total 0
drwxrwxrwx. 3 jm jm 69 Aug 14 13:50 .
drwxrwxrwt. 9 root root 238 ...
0
votes
2
answers
2k
views
Find size of file names with space and hyphen | pass file names containing space and hyphen to "du" [duplicate]
I have a file, which contains the name of some files. I want to find the total size of files in the list.
#cat filelist
/tmp-directory/connector_db_ connector_db
/tmp-directory/connector_db -...
2
votes
2
answers
5k
views
execute windows program with parameters from cygwin
I want to execute a windows program in cygwin console. I have tried various forms but I don't find the correct syntax.
$ cmd /C "C:\Program Files\sqldeveloper\sqldeveloper\bin\sdcli.exe format ...
19
votes
1
answer
46k
views
What characters need to be escaped in files without quotes?
I have browser-based shell/terminal that executes bash commands and I'm escaping spaces but it turns out that parenthesis also need to be escaped. What other characters need to be escaped for file ...
0
votes
2
answers
90
views
chmod files with group - error on files with (
I have the need to chmod files which are in a certain group. I have come up with this construct:
find . -group groupname -exec sh -c 'su -c "chmod -R u+w,g-w,o-w,g+r,o+r ." - groupname {}' \;
This ...
11
votes
5
answers
8k
views
How to remove a folder that starts with “$”? [duplicate]
I created a directory named "$pattern" and now when ever i try to remove it, it says
pattern: Undefined variable.
I have tried:
$ rm -r $pattern
$ rm -rf $pattern
$ rm "$ option[value='2016']"