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

learn more… | top users | synonyms

4
votes
2answers
498 views

Dots in path name

I am receiving 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
1k 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
7k 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) ...
2
votes
2answers
431 views

Script to convert filenames to lowercase depending on extension

Script to convert filenames to lowercase depending on extension
0
votes
1answer
255 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
1k 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 ...
7
votes
3answers
5k 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 ...
5
votes
5answers
3k 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
192 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
581 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
1k 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 ...
5
votes
2answers
1k views

What is the difference between .ini and .conf?

As mentioned, what is the difference? or is there any concern to use them?
0
votes
1answer
76 views

Find and use the path of a file?

I'm trying to find the path of a file and move it. When I try realpath, it is not useful. For example : I want to move the file All Hail the Generalist - Vikram Mansharamani - Harvard Business ...
2
votes
2answers
2k views

How to fix Linux filename tab autocomplete that is appending a space instead of trailing slash on directories?

For some strange reason my filename autocomplete is behaving differently than normal. Given the following file structure ./foobar/file.txt, if I want to delete file.txt, I type rm ...
17
votes
3answers
5k views

When should I use a trailing slash on a directory? [duplicate]

Possible Duplicate: How linux handles multiple path separators (/home////username///file) Most commands I use in linux behave exactly the same whether I include the trailing slash / ...
5
votes
2answers
935 views

How to put the specific files from a directory in an array in bash?

Suppose I have a directory under which there are 3 files named: file1.txt,file2.txt and file3.txt. Now how can I fill an array with those file names(I just know that all the files have certain ...
1
vote
2answers
1k views

Reserved characters in file names

I was under the impression that the only character not allowed in file names was /, but I don't seem to be able to create a file whose name contains characters such as *, \, ", :, |, < or > ...
5
votes
1answer
2k views

For filenames, are underscores or dashes more common in Unix file names?

When you are naming files with multiple words in the name, is it more common in Unix systems to use underscores, camel case, or dashes to separate the words?
1
vote
1answer
80 views

Tab completion when `patch` asks for filename

When the patch command doesn't find the file to patch, it asks for a filename. Is there any way to get this to use tab complete?
2
votes
1answer
563 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 ...
2
votes
2answers
242 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 ...
9
votes
7answers
8k views

Bulk rename, change prefix

How can I bulk replace the prefix for many files? I have a lot of files like TestSRConnectionContext.h TestSRConnectionContext.m I would like to change all them to CLConnectionContext.h ...
4
votes
6answers
3k views

cat files with directory

Is there a command to show the directory/file name when cat files? For example: assume two files f1.txt and f2.txt are under ./tmp ./tmp/f1.txt ./tmp/f2.txt Then when I do cat ./tmp/*.txt, only ...
0
votes
2answers
819 views

File extension case sensitivity on CentOS [duplicate]

Possible Duplicate: How to clean up file extensions? I'm using CentOS. There are >10M images in one of my folders, which are furthur grouped into subdirectories. The issue is that some of ...
2
votes
4answers
4k views

How can I find all files in a folder that contain a match of a regular expression in the file name?

I'd like to find all of the files in my home folder on Linux (Ubuntu, in this case) that contain a match a particular regular expression. Is there a simple Unix command that I can use in order to do ...
2
votes
2answers
255 views

Is it possible to add CP-1252 support to CentOS?

We have a CentOS backend running server software that is processing files generated by our clients. Many of our clients are Windows users, and generate these files on their Windows machines in the ...
3
votes
1answer
201 views

What is this file called - doing in my home directory?

In my home directory there is a file called -. Seeing inside it was hard, but I finally managed to do it. At the top was this: -----BEGIN PGP PUBLIC KEY BLOCK----- followed by a bunch of ...
4
votes
2answers
3k views

Remove prefixes from filenames

I have a bunch of files as follows: 04602635_b0294.DAT20120807164534 04602637_b0297.DAT20120807164713 04602638_b0296.DAT20120807164637 04602639_b0299.DAT20120807164819 ...
4
votes
4answers
8k views

How to get only filename using sed

How can I get only the filename using sed? I've this out_file=$(echo $in_file|sed "s/\(.*\.\).*/\1mp4/g") But I get the path too /root/video.mp4, and I want only video.mp4.
3
votes
1answer
1k views

Displaying text path in Caja (Linux Mint file manager)

In Linux Mint 13, the default configuration (under MATE) shows icons for the path rather than a text box containing the path. This is a huge issue for interfacing with the command line or programs, ...
5
votes
4answers
864 views

Good style/practices for separators in file (or directory) names [closed]

I'm not exactly sure if this is a "right" question to post here. I'm probably asking more about "opinions" than actual categorical answers (of those that either work or don't, and that's it). I was ...
26
votes
0answers
661 views

Completing avfs fake directories in zsh

How can I tweak zsh's completion system to complete “fake” files in some circumstances? More precisely, the AVFS filesystem exposes archives as directories by creating a “fake directory” next to ...
2
votes
1answer
440 views

Detect file-type with the help of magic-file and rename file-suffix accordingly

I have a folder (the iPhone Backup) with various files without a suffix. I want to run a batch process over these files, which detects each file's file-type (with the help of the magic-file database ...
6
votes
3answers
497 views

Bash autocomplete gives different file name than ls

An incredibly strange thing just happened. Through a serious typo, I entered cp filename.xsl .^?~ Yeah, that's right, dot-caret-questionmark-tilde! Truth is stranger than fiction. It gets weirder. ...
25
votes
2answers
6k views

What does dash “-” at the end of a command mean?

Given the following command: gzip -dc /cdrom/cdrom0/file.tar.gz | tar xvf – What does the - at the end of the command mean? Is it some kind of placeholder?
2
votes
0answers
214 views

How to limit ext4 filenames to only those filenames legal in FAT?

The ext4 filesystem allows some characters that FAT does not allow, such as :. This has caused me much grief in the past when trying to move files, especially as KDE will delete such files instead of ...
2
votes
4answers
2k views

chown all files based on file name pattern in current directory

I'm trying to chown all files whose filenames begin with ChownFileNames. I've used this command, but it doesnt seem to work: find . -maxdepth 1 |grep 'ChownFileNames*' -exec chown hadoop:hadoop -- {} ...
5
votes
6answers
2k views

Strange case: Text file that exist and doesn't exist

I'm completely puzzled about a problem with a single plain text file in my system fedora 12. I used a known software in bioinformatics, maker, to produce lots of plain text files and one of them it ...
3
votes
2answers
1k views

How do I find a bunch of files with a string in its filename (or body text) and then move all those files to a specific folder?

Say - what if I wanted to move every HTML file in several independent directories with the word "heavengames" in its filename (and as a second question, every HTML files with the word "heavengames" in ...
0
votes
1answer
269 views

Checking existence of file with underscore in file name in zsh

I am writing a very simple script which will link shared configuration files. For some reason it does not behave as i expected for file with underscore in name. Does _ (underscore) means something ...
5
votes
1answer
142 views

Can non-canonicalized forms of filesystem paths be significant? (eg. “foo//bar”, “foo/./bar”, and “foo/../bar”)

I have a script for building a particular flavor of GCC cross-compiler. Throughout the script there are many paths that are not in canonical form, such as duplicate path separators (/xxx/foo//bar/yyy) ...
14
votes
3answers
4k views

Understanding Unix file name encoding

I have a hard time understanding how the file name encoding works. On unix.SE I find contradicting explanations. File names are stored as characters To quote another answer: Several questions about ...
4
votes
3answers
448 views

Need to delete a directory with name '~' created accidentally

I don't remember exactly how this directory got created. It's name is ~, the alternative we all use for home diretory. I also see a sticky bit attached with this directory. How shall I delete it? I ...
1
vote
2answers
137 views

How to copy a file and move it to a location using unix

I need a file to stay in the same location but also move it to a different location. What am I doing wrong? cp RubyTest.sublime-settings \ ~/Library/Application Support/Sublime\ Text\ ...
6
votes
3answers
1k views

Glob with Numerical Order

I have this list of pdf files in a directory: c0.pdf c12.pdf c15.pdf c18.pdf c20.pdf c4.pdf c7.pdf c10.pdf c13.pdf c16.pdf c19.pdf c2.pdf c5.pdf c8.pdf c11.pdf c14.pdf c17.pdf c1.pdf ...
6
votes
2answers
2k views

UTF 8 filenames?

In unix based operating systems are utf6 filenames permissible? If so do I need to do anything special to write the file to disk. Let me explain what I'm hoping to do. I'm writing an application ...
4
votes
1answer
585 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 ...
1
vote
1answer
177 views

How to get a list all the “aliases” of a file (including of type directory) efficiently?

How can one get the list of all the aliases of a file (including of type directory) efficiently, given that a file: may have multiple hard links, multipe soft links, multi-level soft links may be ...
5
votes
4answers
843 views

For each subfolder, sort files by name and rename them to sequential padded numbers (regardless of extension)

I have the following directory structure: . ├── event-a │   ├── album-a │   │   ├── a.jpg │   │   └── x.png │   └── album-b │   ├── a.jpg │   ├── x.png │   └── y.gif └── event-b ├── ...
3
votes
3answers
580 views

Unique file name for different files

I'm working with graphic design. I've downloaded many files (EPS files, PSD files, etc) from various websites. Because it come from various websites, after downloaded from more than 10 different ...