The filenames tag has no wiki summary.
3
votes
1answer
328 views
File name encoding wrong in KDE, but correct in GTK/tty1/
I'm on a new Linux (installed yesterday). When I access files from old partitions their file names have incorrect encoding (ä instead of ä, same for other umlauts) inside KDE apps like dolphin and ...
3
votes
3answers
52 views
Portable way to get script's absolute path?
What is a portable way for a (zsh) script to determine its absolute path?
On Linux I use something like
mypath=$(readlink -f $0)
...but this is not portable. (E.g., readlink on darwin does not ...
7
votes
6answers
2k views
List files sorted numerically
I have a bunch of files from log1 to log164.
I'm trying to LIST the directory (sorted) in a UNIX terminal but the sort functions are only providing the format like this:
home:logs Home$ ls -1 | sort
...
8
votes
1answer
132 views
Is there a way to prevent the creation of a given file?
When ever I use a browser reading PDF the acrobat plugin is used producing a file called C:\nppdf32Log\debuglog.txt in my home. Is there any way to prevent that this given file can be created? I mean ...
16
votes
7answers
21k views
Looping through files with spaces in the names?
I wrote the following script to diff the outputs of two directores with all the same files in them as such:
#!/bin/bash
for file in `find . -name "*.csv"`
do
echo "file = $file";
diff ...
-4
votes
1answer
58 views
How to copy datasets from prior version directory to latest version directory [closed]
I've go a number of directories named like:
/data/db/OX/8_10
/data/db/OX/9_1
/data/db/OX/9_2
And need to copy some files (all the pt.* files) from the second latest one (above 9_1) to the latest ...
0
votes
2answers
34 views
Comparison of forbidden symbols and names in different FS's
What symbols and (maybe) names are forbidden on different files systems available in modern Linux distribution?
2
votes
1answer
281 views
Predict filename before downloading from a URL, in shell script
I have a shell script that downloads files from a list using wget, and resumes automatically if there is any non-critical error (because of unstable WIFI during storms).
The problem is, I want to ...
3
votes
3answers
801 views
Split a file by line and have control over resulting files extension
There is a standard command for file splitting - split.
For example, if I want to split a words file in several chunks of 10000 lines, I can use:
split -dl 10000 words wrd
and it would generate ...
-2
votes
0answers
53 views
GCC errors out on code that used to work fine [migrated]
I have a program that has successfully compiled in the past, but now I get a bunch of errors.The source code is just:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
...
34
votes
2answers
2k views
Why do some Linux files have a 'd' suffix?
I am new to Linux. I observed some of the binary files and configuration file name s end with a d.
What is reason for putting a d at the end of the file name?
Like httpd, ospfd, pppd, syslogd, ...
0
votes
1answer
30 views
Searching for multiple files and changing file extension [duplicate]
I want to search and identify multiple files, within a directory, having a particular file extension (.txt) and changing the extension to (.fasta). This is considering not changing the file itself, ...
0
votes
5answers
95 views
File extensions and association with programs in linux
In windows we can associate a file's extension with programs.
E.g. a file test.pl can be run by the installed Perl interpreter due to the pl extension.
In linux though it needs #!/usr/bin/perl as the ...
2
votes
3answers
79 views
Filter a list of strings using math
I have a directory with files listed like so:
abc201303130110.txt
abc201303140511.txt
abc201303150112.txt
As you can see, the filename contains a datetime stamp. I want to return all files with the ...
4
votes
1answer
73 views
Using '@' for a directory name
Though Unix/Linux will technically allow any character in file and directory names, using punctuation is almost always fraught with peril due to the extensive use the O/S makes of punctuation for ...
2
votes
5answers
94 views
move a directory with a single character (back quote) as its name [duplicate]
How can I move a directory whose name is just a space?
ls -lah
drwx------ 4 user1 user1 8.0K Mar 13 14:16 .
drwxr-xr-x 3 root root 60 Mar 13 13:48 ..
drwx------ 18 user1 user1 4.0K Mar 13 11:18 ...
1
vote
1answer
76 views
How to prevent double escaping?
I'm trying to put a bunch of images together into a pdf. I ran gm convert *.jpg out.pdf and it worked, but the images were not in the right order.
I found that ls -v orders them correctly so then I ...
5
votes
3answers
86 views
Filtering redundant paths from a list of paths
I have a list of relative paths such as this:
dir1
dir2
dir2/dir3
dir2/file1
dir3/file2
dir3/dir4
dir3/dir4/file3
In the example above, the specifier dir2/file1 (for example) is redundant, because ...
5
votes
3answers
178 views
Files with empty names
I was writing a widget for displaying files in a given directory and I wondered whether I need to cover the case where a file has an empty name.
Testing showed not obvious results, so I was ...
0
votes
2answers
208 views
Synchronizing same files with different filenames using rsync [duplicate]
I have a directory ~/music that contains all my music files and a directory /media/backup/music that I wish to synchronize with the first one using rsync. Initially, I did a rsync -a ~/music ...
1
vote
3answers
123 views
Reading a directory in shell script
I want to read a numbered directory which is under a path, into a variable in shell script.
The paths are something like this:
.../releases/R1/...
.../releases/R2/...
.../releases/R3/...
Each time ...
8
votes
6answers
302 views
Is there a terminal app that allows filenames to be clickable?
Is there a terminal emulator (extension or app) that does link resolution for local paths?
In particular when I see things like:
...
7
votes
3answers
263 views
What are ./ and ../ directories?
Simple question, but I'm not sure where to look and google doesn't respond to periods and slashes.
I'm just trying to count the # of files & directories in the current directory (not including ...
1
vote
2answers
119 views
How to “grab” matching files from a lookup file in bash?
I have a lookup file containing filenames. I also have a directory containing files, some of which have the names that correspond to some of the names in the directory.
How can I:
Move exact ...
7
votes
1answer
134 views
What is the significance of the dot in bash commands and how is it different from an asterisk?
I'm trying to understand the significance of the dot in bash and how it differs from an asterisk. Can someone please elaborate? For example, what's the difference between cp -ar /foo/. /foo2/ and cp ...
3
votes
6answers
470 views
finding the absolute directory
Here is the scenario:
foo/
> data/
> stuff/
> scripts/ -> /.../generic/scripts
When calling foo/scripts/bar.sh from any location (other folder or inside the folder), I would like to be ...
3
votes
1answer
69 views
Symbolic link starting with .#
I have a symlink in one of my directories that has the following name:
lrwxrwxrwx 1 XXXX ZZZ 37 Jan 15 18:18 .#perl.org -> XXX@YYY.com.2980:1344441539
I am wondering what this symlink ...
1
vote
2answers
230 views
Command to find file/path lengths that are too long for burning to DVD?
I'm trying to burn a DVD from Windows but it fails because the full path name length exceeds the limit of something like 255 characters.
Our files are stored in Debian Linux (accessed by Windows ...
1
vote
2answers
213 views
Bash script that reads filenames from a pipe or from command line args?
I want my script to read a bunch of filenames (which may have spaces) given either as a glob or from STDIN and do stuff with them. I've been able to read either way separately, but not combine them.
...
0
votes
1answer
59 views
Need a good convention of file naming when it comes to `'` [closed]
I know that the file naming style is a personal stuff, and the most crucial part is consistency. But I just get stuck with the situation when I want to convert the name of a music file, say He's ...
3
votes
3answers
164 views
How do I remove carriage returns from directory names?
I created a file in Excel and ftp'd the file over to my Linux machine. In the file were a bunch of mkdir commands. Now all of the newly created directories have a carriage return at the end of them. ...
12
votes
3answers
3k views
bulk rename (or correctly display) files with special characters
I have a bunch of directories and subdirectories that contain files with special characters, like this file:
robbie@phil:~$ ls test�sktest.txt
test?sktest.txt
Find reveals an escape sequence:
...
2
votes
2answers
130 views
cp file device:directory on Minix
In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line:
cp ...
0
votes
2answers
85 views
file command + how to view all results from file command
I use the file command in order to verify if file (PATH) is text/ascii file or encrypted file
Because file command have allot of results ( small example in example 1 )
I want to get the all ...
2
votes
3answers
197 views
Manipulate file name piped from find command
I'm relatively new to Bash and am trying to do something that on the surface seemed pretty straightforward - run find over a directory hierarchy to get all of the *.wma files, pipe that output to a ...
0
votes
1answer
180 views
setup filename encryption for encrypted home folder in eCryptfs
I used ecryptfs-migrate-home to encrypt my home folder on my Debian (Testing) system.
As I am a complete encryption-greenhorn, I don't know yet how to check, if the encryption succeeded. However, I ...
0
votes
3answers
181 views
How to match a file name suffix
How to verify if the name of a .xml file name ended with .any-string? e.g. .previous or .backup or bck12 etc ...
I need to print the XML file name except for XML files that end with ...
2
votes
2answers
219 views
Script to convert filenames to lowercase depending on extension
Script to convert filenames to lowercase depending on extension
3
votes
1answer
74 views
Dots in path name
I am recieving an error from an application I am running.
The error looks like this:
john@john-replacement:~/Desktop/yarbu-1.4.8/bin$ sudo yarbu-engine --VERBOSE
/usr/local/bin/yarbu-engine: line ...
3
votes
2answers
242 views
Convert file path to URI in bash
How can I convert a file path to an URI in the command-line?
Example:
/home/MHC/directory with spaces and ümläuts
to
file:///home/MHC/directory%20with%20spaces%20and%20%C3%BCml%C3%A4uts
2
votes
3answers
303 views
print output to 3 separate columns
MYPATH=/var/www/html/error_logs/
TOTALFILE=$(ls $MYPATH* | wc -l)
FILETIME=$(stat --format=%y $MYPATH* | head -5 | cut -d'.' -f1)
FILE=$(ls -1tcr $MYPATH* | head -5 | rev | cut -d/ -f1 | rev)
...
0
votes
1answer
64 views
Create a File with Touch on a specific Directory
I want a create a file with a specific extension(.done). I am using the command touch. Something Like:
touch `basename $UNZIPFILE`".done"
It's creating the file but in current directory. I want to ...
4
votes
1answer
194 views
Does tar -x Extract to Current Directory or Does it Extract to the Source of the Archive?
Does tar -x by default just extract to the current directory or does it try to reproduce the original directory structure including overwriting the original source? I know I can specify a folder to ...
4
votes
3answers
463 views
adding text to filename before extension
I would like to add text to the end of filename but before the extension. Right now I am trying,
for f in *.shp; do echo $f_poly; done
the output is,
Quercus_acutifolia.shp_poly
...
4
votes
4answers
569 views
Replace dots with underscores in filenames, leaving extension intact
I have a bash script which I'm trying to get to replace dots in filenames and replace them with underscores, leaving the extension intact (I'm on Centos 6 btw). As you can see from the output below, ...
3
votes
1answer
95 views
Linux Icon Naming Conventions
Is there a naming convention in Linux when it comes to application icon filenames? What I'm referring to is the practice of including the icon size in the filename if the application uses multiple ...
3
votes
3answers
220 views
Tar a file with a different name
To make my environment deployable, I occasionally tar up some handy files and scripts:
tar -czvf env.tgz .vimrc .vim/ bin/lsl bin/s
I would like to add .bashrc to the mix, but I have some sensitive ...
1
vote
1answer
156 views
Very basic question, ls a different directory and save file
I seriously can't understand where I'm going wrong with his question. The first part is.
List all the file and directory names in /etc which have 1 or more numbers in their name. Remember to use ...
4
votes
2answers
235 views
What is the difference between .ini and .conf?
As mentioned, what is the difference? or is there any concern to use them?
3
votes
2answers
960 views
What is the maximum allowed filename (and folder) size with eCryptfs?
I am a new eCryptfs user and I have a very basic question that I wasn't able to find anywhere.
I am interested in using eCryptfs via my Synology NAS that uses Linux.
While trying to encrypt my folder ...

