File name is a name used to identify a file uniquely on given file system.

learn more… | top users | synonyms

0
votes
0answers
15 views

Specify a file with special characters in its name [duplicate]

$ ls -ltr total 8708 -rwxrwx--- 1 root plugdev 8293 Oct 17 02:39 --layout $ rm *ayout rm: unrecognized option '--layout' $ rm "*ayout" rm: cannot remove `*ayout': No such file or directory ...
1
vote
0answers
16 views

Autocomplete include directories in c++

VisualStudio has some extension which checks the include directories and makes suggestions while typing. My current project uses a lot of included libraries, sometimes with rather long pathnames. ...
3
votes
1answer
30 views

dhcpd does not allow filename option with a colon in it

For some reason, tftpboot does not work with a colon in filename parameter: group { filename "node7:linux/pxelinux.0"; host machine_7a { hardware ethernet 02:01:02:02:01:11; ...
1
vote
2answers
67 views

(SOLVED) How I get the current working directory with inverted slash?

I'm trying to write a script to import a font in wine, because I put the font in wine's c:\Windows\Fonts, but wine doesn't read it if I don't import from the reg file: "Font ...
0
votes
1answer
79 views

Extract values from filename and add it into a text file

I have a gridded model data (separated by different depth) saved in text files. The structure is like this: Format of every column in a row in the text file: x_coordinate y_coordinate density ...
1
vote
1answer
37 views

Stop zsh from completing parent directories

I am using zsh with grml's zshrc as a base. As part of my work I access network path regulary (e.g NFS. AFS.) If I write /a/long/network/path/on/the/other/side/of/the/world press TAB twice it is ...
1
vote
1answer
17 views

What are the files in /tmp that start with “qipc”?

There are empty files like this in my /tmp directory: qipc_sharedmemory_soliddiskinfomemac5ffa537fd8798875c98e190df289da7e047c05 ...
8
votes
6answers
433 views

When does the empty string denote the current directory?

In a script I use find to collect some files in the current directory, as in $ find . -name "*.h" ./foo.h Now I'd like it to just output foo.h, without the ./ prefix. I thought that the empty ...
1
vote
1answer
57 views

shell for loop with find with filenames containing spaces [duplicate]

Consider a directory with typical Microsoft Windows filenames: New Document.txt Foo.doc Foo - Copy.doc I'd like to do something on each file such as: for sendfile in $(find ${POLLDIR} -type f ...
1
vote
0answers
24 views

About the status of the File Hierarchy standard

In the question Where can I find the Official File Hierarchy Standard for UNIX? one writes: As with all things unix, it's less of a law and more of a guideline; how much of it is adhered to varies by ...
24
votes
8answers
2k views

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually ...
0
votes
1answer
29 views

Find file names for executables, which are not used by other projects already

A new program which should be deployed as package for the major distributions should avoid name clashes. ls /usr/bin can show me that tail is a bad choice for a new binary file name. But how can I ...
2
votes
2answers
48 views

Is there an improved version of “pick” that will work with filenames with spaces?

Is there a version of the pick script that will work properly with spaces in the filenames? This is a tricky question—pick is trivial to enhance to work with spaces in filenames, but the output ...
2
votes
1answer
77 views

auto complete in shell script

My folders are named by date: 20140930DoingShellStuff 20140931HopefullyShellIsDone ... What I want to do is write a shell script to auto cd into the folder which corresponds to the current date. I ...
0
votes
2answers
35 views

Disallowing blank space in file system naming

Most recent versions of most Linux distros allow blank space in file and directory naming. I was wondering if there is a way to disable that and go back to the old UNIX standard of no spaces in file ...
0
votes
1answer
38 views

Form a relative path, going via a parent directory

My question is about relative addresses. I need to create a relative address that goes upwards, then sideways, and then downwards. Is this do-able? Or am I required to use absolute addressing? I ...
5
votes
1answer
101 views

How to colourise hidden files in `ls` file listings?

LS_COLORS environmental variable lets you decide on colours for different file types for ls command, such as, directories, regular files, links etc. I suppose that dot files are considered a variation ...
0
votes
2answers
48 views

No such file or directory when copying files to current directory

I am trying to copy a file from inside a bunch of folders to the current directory I am in. Playing around with the terminal, I see that when I specify the entire location it works: joostin@ubuntu:~$ ...
2
votes
3answers
77 views

Copy files by date/time order contained within filename?

I have a bunch of files with a pattern like this: {UID}-YYMMDD-HHMMSSMM-NEW.xml Or a real example: 56959-140918-12465122-NEW.XML I want to copy these files to another directory in date and time ...
-3
votes
1answer
69 views

Shell Script to copy the file to another folder

I am new to Linux, I have to write .sh file which will be called from .Net Application. Script.sh has to move the file from rootdirectory to a specified folder. I am expecting to pass SourceFilePath ...
13
votes
4answers
1k views

Is it correct to use certain special characters when naming filenames in Linux?

Is it correct to use certain special characters, as +, &, ', . (dot) and , (comma), basically, in filenames. I understand that you can use - and _ with no problem, but doing some research I have ...
1
vote
3answers
51 views

rename hundreds of file by removing last few characters

I have hundreds of file andI want to remove last 7 characters from the filename but keeping its extension. Old name: abc_xyz12_4567.txt abcde_xyz12_4567.txt New name: abc_xyz.txt abcde_xyz.txt ...
31
votes
1answer
2k views

Why can Linux show a file name containing character '/'?

The following picture is snapped in a real Linux environment. Why can Linux show a file name containing character '/'?
0
votes
1answer
46 views

Changing file name from dbf to ods problem?

I was trying to change the file name from gdf to csv in the folder using $for i in *.dbf; do mv $i ${i%.dbf}.ods; done script. The code changed all the gdf to csv, but the content of the new ...
2
votes
3answers
111 views

Convenient way to name files in Linux

I'm a beginner in Linux and want to learn to do things properly in this environment. Since the beginning I've noticed that a lot of people involved in Linux (like tutorials and guides) tend to name ...
3
votes
1answer
51 views

Mounted volume name in terminal is different from in GUI

The basic problem is that in the GUI shows a directory name with no space but when I cd to it in the terminal, the directory name has a space in it. What would cause the names to be different? The ...
1
vote
2answers
34 views

Remove all files without a keyword in the filename

I have a list of files in the following fashion: > file1.jpg > file1_orig.jpg > file2.jpg > file2_orig.jpg I want to keep all the files with the extension _orig.jpg and discard those ...
2
votes
3answers
56 views

What is the system-level effect of file permissions? [closed]

I know that r means read permission, w means write permission, and x means execute permission in the output of ls -l, like -rwxr-xr-x. But My question is what is behavior difference on operation ...
2
votes
1answer
25 views

Regarding identical copies of gedit files

When ever I save a gedit file in a directory, two copies of it get saved with identical content. Ex: If the gedit file is named as file_name and saved in Home directory then when u ls the Home ...
5
votes
1answer
1k views

How can two files in one of my folders have the same name?

I downloaded two files, they were both saved to the same filename and then I transferred them with scp to another computer. Why didn't they become one when the second was saved?
1
vote
2answers
115 views

Rename a file dynamically containing spaces [duplicate]

I want to rename a file dynamically based on data which contains spaces Name="Abc DEF" Name1="GHI JKL" mv /sample/pdf/noriginalName.pdf /sample/outputPdf/${NAME}${Name1}".pdf" But it gives me an ...
4
votes
1answer
335 views

replace all dots in filenames with underscore

I have a directory with some subdirectories with filenames and directorynames that contain some dots: $ ls -R .: dir file.with.dots ./dir: subdir.with.dots ./dir/subdir.with.dots: other.file I ...
2
votes
2answers
56 views

Names of copied files from USB device to HDD have all become uppercase. How to fix it?

I am currently using OpenBSD 5.5-release. Whenever I copy files or directories from my USB device to the local HDD, the names of the copied files have all become uppercase. What causes it? How do I ...
21
votes
3answers
2k views

How to rename file to .. (dot dot)?

Apparently you can rename file to .... If I were insane, how would I rename file to .. or .? Is such a filename even allowed? Backslash doesn't seem to disable dot's special meaning: $ mv test \. ...
9
votes
4answers
2k views

Is space not allowed in a filename?

It is said that on Unix and Linux in general, you should avoid having spaces in a filename of a file (ordinary file, dir, link, device file, ...). But I do that all the time. For a filename with a ...
1
vote
1answer
16 views

Remove GET parameters from file names in directory

I need to remove the part starting with ? from a bunch of files with names like image.jpg?foo=bar&bar=foo. Would someone please show me how it's done? These commands aren't working for some ...
3
votes
3answers
165 views

filename and pathname of a file

It is said that the filename of a file is a pointer pointing to the inode of the file. Before knowing that, I thought it was the pathname of a file that does that job. I am not sure how a pathname ...
1
vote
1answer
43 views

processing multiple extensions

I have done a script to convert recursive .jpg files to another size: echo $re mkdir "$re"_tmp for a in *.jpg ; do convert "$a" -resize $re "$re""_tmp/${a%.*} ["$re"].jpg" ; done I'd like integrate ...
5
votes
2answers
197 views

File handles and filenames

I read this post. Are file descriptors the same as file handle? While trying to configure the linux kernel, it asks open by fhandle syscalls (FHANDLE) [Y/n/?]. Why is this option provided? Does ...
1
vote
2answers
147 views

How would I change file permissions if the file name has a space in it in linux [duplicate]

I would like to know how would I rename and change file permissions of a file that contains a space in the name on Linux. Example The name of my file is: my file I have tried mv my%20file my_file ...
3
votes
2answers
49 views

How to build space separated, escaped full paths of files recursively matching glob?

I have a program which requires paths to files as arguments, which cannot be quoted and must not depend on working dir. Can this be done without chaining multiple xargs, tr, find, readlinks? Example ...
2
votes
3answers
245 views

sed + remove the first directory from path

Please advise on how to remove the first directory from a path by sed, (the inverse pf what basename does). For example echo "/mnt/VPfig/Amer/AR4/Celtel/files/COM.txt" | sed ... I should get: ...
4
votes
5answers
427 views

Bash pattern to match all files but directories

In bash, how do I specify a pattern that matches everything but subdirectories in current directory. Given that the pattern */ matches all the subdirectories, I tried (with extglob turned on): $ echo ...
2
votes
1answer
35 views

How do I get the filename received by rz?

I want to rz a file and then copy it to a different location. But I find no way to figure out the received filename in the rz help or in its man page. The rz man page, while attempting to be funny, ...
1
vote
1answer
58 views

How could I retain special character without replacing it with underscore?

I'm working on a file transfer script where I encounter a problem, when the file name look like Dr' A. The transfer script will fail due to following error: sftp> put /path/Dr'\ A.tif Unterminated ...
4
votes
1answer
32 views

batch rename files

I have multiple photo files with inconsistent name format. beach north.JPG beach south sm.jpg Bryce windsurfing sm.jpg DSC01031 1024x.jpg DSC02652 ed sm.jpg DSC03229 sm.jpg Kayak kids 2.jpg Maui ...
1
vote
1answer
56 views

Create a log file with the same name as input file

I'm new to linux shell scripting. I have few input files that I have to parse one by one. So in my "work in progress" WIP folder I have one input file at a time. While one file is under processing I ...
19
votes
2answers
845 views

Tilde (~) inside working unix directory

So, Im working in a UNIX environment and I noticed that inside my working directory, which is miles miles away from my UNIX home, there is a ~. Now, once in the past, I did rm -rf ~ from my working ...
1
vote
2answers
65 views

Problems with basename in a loop

I am new at shell script programming and I'm trying to execute a software that reads a text and perform it's POS tagging. It requires an input and an output, as can be seen in the execute example: $ ...
11
votes
7answers
896 views

Shortest way to extract last 3 characters of base (minus suffix) filename

I'm trying to set a variable in an sh script to the last 3 characters of the base name of a file (by base name I mean without the path and without the suffix). I've succeeded in doing this but, purely ...