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

learn more… | top users | synonyms

-1
votes
2answers
33 views

Gzip Mutliple files using single command [on hold]

Want to Gzip my all the .csv files into a gzip file. I am using this command. gzip *.csv; Problem File contains '//' in its name that's why command is giving error. Error : - '//File.csv' is not ...
0
votes
1answer
31 views

Remove a folder with the same name as an environment variable

I was messing around with a log4j properties file and accidently made a folder with the following text ${foo} however I also have an environment variable named foo that points to a folder so thus if I ...
1
vote
3answers
28 views

Moving files recursively if certain condition is met

I have the following directory tree: records/13/2014.12.16/00/05.mpg records/13/2014.12.16/00/15.mpg records/13/2014.12.16/01/05.mpg records/13/2014.12.16/02/15.mpg records/15/2014.12.14/05/25.mpg ...
0
votes
1answer
40 views

Create a file using special characters as filename

I have to create such filename, so I can try one pipeline but I am not quite sure how it would happen. So the file's name(s): ;rm *;.jpg (or ;rm -rf *;.jpg). The format of the file doesn't matter, I ...
3
votes
3answers
425 views

Replace %20 with a space in filenames? [duplicate]

I have a list of files that are using %20 to indicate a space in their names. I'm currently trying to do the following to change them all from %20 to a space " ". for x in *.txt do mv $x $(echo $x ...
2
votes
2answers
76 views

order for listing files

If I have a list of files under a directory ullman-000.pbm ullman-001.pbm ... ullman-098.pbm ullman-099.pbm ullman-1000.pbm ullman-1001.pbm ullman-1002.pbm ullman-1003.pbm ullman-1004.pbm ...
1
vote
2answers
46 views

how to extract path from file location using shell [duplicate]

how to extract path location from below given string. /opt/oracle/app/oracle/product/12.1.0/bin/tnslsnr expected output. /opt/oracle/app/oracle/product/12.1.0/bin (or) ...
12
votes
2answers
200 views

Security implications of running perl -ne '…' *

Apparently, running: perl -n -e 'some perl code' * Or find . ... -exec perl -n -e '...' {} + (same with -p instead of -n) Or perl -e 'some code using <>' * often found in one-liners ...
0
votes
1answer
29 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
102 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
48 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, ...
2
votes
3answers
72 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
78 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
52 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
329 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
100 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
27 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
110 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
45 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
75 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
295 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
47 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
49 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
342 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 ...
3
votes
5answers
372 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
24 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
38 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
91 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
100 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
59 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
25 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
469 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
114 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
26 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
119 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
39 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
42 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
125 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
107 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
222 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
198 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
100 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 '/'?