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

learn more… | top users | synonyms

0
votes
1answer
12 views

defining rename command scope; replace word; replace entire file name; wildcards

Im looking to use the rename command to edit file names. More specifically, Im trying to isolate specific pieces to change, or in some cases, the whole name. For example: Lets say I have three ...
1
vote
2answers
62 views

Sort files according to their extensions

I have made a script that will sort files according to their extension and place them in the proper folder. For example, place abc.jpg in the directory jpg. #!/bin/bash #this script sorts files ...
2
votes
2answers
47 views

Efficiently copy names in shell

I have noticed an efficient technique that some users use to quickly copy directory and file names in the terminal or shell. The behavior/usage is as follows: Issue ls Click on the desired entry, ...
1
vote
2answers
44 views

Find files that end with number

Im trying to make some backup script as the log files get bigger and bigger. What i have is coping the current file, (for example secure file in /var/log/) and remove the content from that file. But ...
2
votes
3answers
60 views

How to sort filenames with spaces in them and concatenate the files?

I have the misfortune of dealing with filenames that contain spaces. I want to concatenate files of which filenames contain spaces. I also want to sort the filenames numerically. Obviously the ...
1
vote
1answer
55 views

symlink /home/username/Documenten tot 2nd partition?

I am trying to make a symlink so all documents are on a different harddisk drive. I learned how to make a symlink and tried to create the desired symlink. this is the command I used in terminal: ln ...
1
vote
3answers
44 views

How to remove matching files from directory A in directory B in the command line?

I have some duplicate files in directories A and B, how could I delete the dupes in B using the filenames from A in bash? How to do it in other shell's is a welcome bonus.
6
votes
6answers
319 views

Find files whose basenames are the same, but their ext names are not

In a directory, how can we find all the files whose base names are the same, but their extension names are not? E.g. 0001.jpg and 0001.png and 0001.tiff, and 0002.jpg and 0002.png.
1
vote
3answers
84 views

Add or subtract a number from the names of all the files in a directory

I have a number of png and jpg files whose names are numbers, e.g.0100.png, in a directory, How can I add 1 to their names, for example, to get 0002.png and 0003.png from 0001.png and 0002.png ...
2
votes
1answer
20 views

Append same timestamp to multiple filenames

I have several files that I ftp each hour. The receiving system needs to have some sort of identifier that they came from the same batch, so I would like to append a timestamp to the filename. That ...
2
votes
5answers
97 views

How to find different files in UNIX based on . extension?

How to find different files in UNIX based extension. Lets say suppose if I have 100 files for each vamsi.log-vamsi100.log, krishna.txt-krishna100.txt, super.csv..., rajat.jpeg..., ...
0
votes
0answers
19 views

Print the page count within the PDFs in a directory to a output txt file [duplicate]

The need has been to identify the total page count of all the PDF files we have in a repository. For that, I was able to come up with the following script. However, I'm now stuck with this situation: ...
1
vote
2answers
44 views

C Shell: different actions depending on the file type

I very new to C Shell. I am trying to read a file from the command line, and determine whether it's a zip file, a .txt, a symbloic link, a pipe, or whatever ("unknown"). Then I'd like to execute a ...
2
votes
1answer
61 views

Convert a Windows-created ZIP to Linux (internal paths issue)

I have a .zip created on a Windows machine (outside of my control). The zip file contains paths that I need to preserve when I unzip. However, when I unzip, all files end up like: ...
3
votes
4answers
260 views

Which directory is taking up the most space

Jenkins has stopped building and I can see from df: that /var is maxed. Following this I can see the culprit is /var/lib/jenkins 52K alternatives ... 4.0K games 2.3G jenkins <--this ...
2
votes
2answers
42 views

Finding duplicate files by name ignoring the case in subdirectories

How is it possible to list duplicate file names on a Linux system ignoring the case including all subdirectories Files should not be compared by their content but only by their names. The output ...
0
votes
1answer
41 views

Spaces in directory name Bash [duplicate]

I'm new to bash and I'm working on script that traverses the tar.gz file archive and in each file changes a string specified to an another string. Args of script: name of archive, searched string, ...
3
votes
1answer
309 views

It's bad to use ls -A to list hidden files?

I want to list every file, including hidden files, in the current directory. I don't want to include the parent (..) and current (.) directory. I found this: how to glob every hidden file except ...
2
votes
5answers
255 views

Stripping directory paths to get file names

What I am doing is converting mp3's with LAME. I already have an old script I wrote that works but I want to add to it this ability--to no longer delete the file but instead save it in a new root ...
0
votes
0answers
16 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
21 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
36 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
79 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
87 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 ...
2
votes
1answer
51 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
20 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
452 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
83 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
25 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
30 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
50 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
94 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
38 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
40 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
114 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
61 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
127 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 ...
-2
votes
1answer
122 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
71 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
3k 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
48 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 ...
3
votes
4answers
137 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
59 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
35 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
57 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
26 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
126 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 ...