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

learn more… | top users | synonyms

-1
votes
1answer
41 views

usr/bin appears empty

I'm trying to make a program (Thunderbird) run at startup, but when I go to usr/bin it seems empty. However, if I run $ which Thunderbird in terminal, it tells me /usr/bin/thunderbird. The usr/bin ...
2
votes
2answers
39 views

List all files with the same name and number of that files

I wonder if there is an easy command to list all files with the same names and number of that files? I would like to do it recursively and I do not mean concrete filename. I can imagine the output ...
0
votes
3answers
60 views

What is the difference between a directory name that ends with a slash and one that does not? [duplicate]

Is there any difference between a directory name such as mydirectory and mydirectory/ I noticed this happens when I execute ls in some directories - some of the directory names have a slash and ...
1
vote
2answers
62 views

how to store output of a command into array with each value in a double quote

I want to store each output in double quoted array values. values can have space also. FOUNDFILES=($(locate --database ~/.locate.db -i -b "$INPUT")) if input to the locate command is very very ...
-2
votes
2answers
44 views

How to find only the name of a link? [closed]

Specifically, I need to write a C program where I put inside the pathname of a symbolic link and on output I print only the name of that symbolic link(not the name of the file pointed by the link). ...
1
vote
2answers
31 views

Script to Compare the “file size” with “last name of file” and if unmatched delete the file

In my environment, we'll be receiving files from clients into our Sftp. Sftp process the files, and move it to another tool, by appending the file size at the end of the file name. For example, ...
2
votes
2answers
56 views

print empty line in sed output when passing multiple filenames

I'm doing some placeholder replacements in various files that I'm feeding to ldapadd, to add new entries to an LDAP directory: sed \ -e 's/%%FOO%%/whatever/g' \ -e 's/%%BAR%%/other thing/g \ ...
2
votes
3answers
256 views

copy all files that have no extension

We can copy some file by extensions like this: cp *.txt ../new/ but how can I copy all files that have no extension?
0
votes
1answer
44 views

Binary not accesible from Bash despite being in path

I am learning how to program in Racket. It's binary is in "/Applications/Racket v6.2/bin/racket". Let me show what happens: MacBook:~ enedil$ echo $PATH /Applications/Racket\ ...
1
vote
1answer
28 views

Redirect a file descriptor before execution

I know that I can change the file a program writes to by interrupting the process in gdb, closing using the file descriptor and then re-opening with the file name I want. Is there a way to do the same ...
6
votes
5answers
104 views

How to find the next available file suffix (file_a.txt file_b.txt etc)

My system creates a new text file every time a certain event occurs. The files should be named file_a.txt file_b.txt file_c.txt etc. In a Bash shell script,how to find out what filename should be ...
4
votes
2answers
112 views

Difference between find ~ and find *

What is the difference between find * and find ~ for searching a file? In terminal when my present working directory on root,then in terminal root@devils-ey3:~# find * -print -quit ~ On same ...
1
vote
2answers
63 views

Rename file containing spaces and punctuation marks

Someone in our Global Linux 3.0.31-0.9 server has put a file with several spaces, parenthesis, question mark and a colon in its name. And I am at my wit's end to rename or remove it! Sample of the ...
1
vote
4answers
74 views

Remove all brackets in filename

I've been trying to remove all brackets in my filename(s). Can anyone help me create a bash script to do that? This bash script below work flawlessly for non-bracket filename(s), but if there are any ...
3
votes
4answers
139 views

Touching issue: Creating a filename from 2 variables

I am trying to create a filename from 2 variables. This is the error msg: touch: cannot touch `/root/tinstalls/2--06/06/15': No such file or directory 2--06/06/15 19:54 This is the code: ...
0
votes
2answers
54 views

Why do some processes end with the letter “d”? [duplicate]

Some Linux binaries end with a "d", for example sshd, httpd, ppd, etc. Why is this so?
20
votes
9answers
2k views

Find files whose name is 4 characters long

I would like to find files whose name has only 4 characters. Example, there are three files under /tmp: $ ls /tmp txt file linux Output should only show file because it only has 4 characters.
14
votes
5answers
891 views

Make pwd result in terms of “~”?

pwd gives me /data/users/me/some/random/folder Is there an easy way of obtaining ~/some/random/folder from pwd?
3
votes
1answer
52 views

Deleting ghost files with non-ASCII characters

I have some weird files and folders in my trash on Mac OS X. After I "empty" the trash, the files still remain. I attempted to manually delete the files: $ cd ...
3
votes
1answer
64 views

How do I rename many files from whatever to sequential filenames? [duplicate]

I have a directory with 8,000 images. These have a variety of filenames and are of type jpeg or png. I want to rename them to: pic00001.png pic00002.jpg I don't mind if I end up doing the pngs in ...
1
vote
3answers
99 views

Script to move one filetype and create a subfolder, if it exists?

I'm trying to find a script that would basically look recusively at a directory, and if the script finds file that are .flac files, it will create a subfolder called FLAC in that same folder, and move ...
20
votes
4answers
2k views

How can I delete a file named “>”?

I was running a Python script that malfunctioned and used sudo to create a file named >. How can I get rid of this file? Of course, when I try sudo rm >, I get the error bash: syntax error ...
0
votes
0answers
11 views

no fonts showing up in filesnames in thunar (and pcmanfm). debian 7.8

I had recently installed a debian 7.8 system. I connect to it both locally from the attached monitor , but also remotely from an nx session. "Fluxbox" is the desktop environment and "thunar" the file ...
-2
votes
1answer
52 views

Move folder from root of Hard Disk to Current Directory [closed]

I'm trying to figure out how to move a folder that sits in the root of my disk (what do you call that, home?) to a subdirectory. I am not cd'd to the root (again not sure of the terminology). When I ...
1
vote
3answers
66 views

Find a file with the extension .csv in a directory matching a pattern

I have a folder in which I have many subfolders. The Root folder name is allCSV and sub foldername is will be like a_date(s), b_date(s), c_date(s) ... I want a file which is in a_date(s) and ends ...
1
vote
2answers
77 views

Copy .txt files in a certain directory

I have an issue in copying my file in my directories. I have .txt and .jpeg files in a lot of directories, and I want to copy only the .txt files according to the directory. For example, I have this: ...
1
vote
0answers
35 views

binary is able to run only when run after creating a symbolic link to it

I am facing a rather strange problem. I have a 32 bit qmake binary placed at a very deep path. So for ease of use I created a link using ln -s /complicated/path/to/qmake ~/qmake I am running a ...
1
vote
1answer
48 views

Searching a filename

How to search a file with a given String and currentTimestamp and if not found trigger a mail? For Ex-:I have to search a file whose filename would be like filename_05172015 and trigger a mail if not ...
2
votes
4answers
105 views

Why . /home/Desktop is incorrect and ./Desktop is correct?

I'm learning about Linux, started yesterday. I have a question which I couldn't answer from my book or Google. What is the difference between ./ and / in the shell? I'm asking this because when I ...
2
votes
0answers
78 views

mv “Not a directory” when target name too long

I'm trying to do an svn checkout on my local Ubuntu 14.04 LTS vagrant box (SSH via MTPutty): vagrant@vagrant-ubuntu-trusty-64:~/shared/dev$ svn checkout https://... [...] svn: E000020: Can't move ...
1
vote
1answer
31 views

Can not get the file names with convmv

I have just uploaded some files on a FreeBSD server. Some files have the ??? into their names. The files came from a windows machine, so I try this: $ convmv -f cp850 -t utf-8 * Starting a dry run ...
2
votes
1answer
50 views

Can not access my external hard drive.

I am fairly new to Linux and have been trying to move some files around with terminal on my external hard drive but I can't seem to get it to work. I am using a generic external hard drive with a ext4 ...
3
votes
4answers
184 views

Overwriting files found by find?

I have a list of files -rw-rw-r-- 1 t t 24813 Oct 23 2002 fig8_21.gif -rw-rw-r-- 1 t t 2259 Oct 23 2002 fig8_21t.gif -rw-rw-r-- 1 t t 35331 Oct 23 2002 fig8_23.gif -rw-rw-r-- 1 t t 2610 Oct 23 ...
0
votes
2answers
122 views

bash - change filename in a loop

So I have my input directory, output directory and list of files: #!/bin/bash ## shell type dir_in=('/Users/dossa013/data/inland-data/input/') dir_out=('/Volumes/Macintosh HD 2/data/cmip5/cru/') ...
0
votes
1answer
83 views

How to ignore spaces in file path for bash select statement [duplicate]

I have the following Bash Script: #!/bin/bash cd ~/Library/Developer/CoreSimulator/Devices/; files=$(find . -name iaGambro_gambro.sql) select file in $files; do if [ -n "$files" ]; then ...
2
votes
0answers
34 views

Can't copy or view files with hangul on HFS+

I'm trying to copy a directory of Korean and Japanese music on a Debian Jessie box. The source file system is HFS+J (Mavericks vintage) from a dead Mac, mounted with hfstools: # mount -t hfsplus -o ...
3
votes
5answers
109 views

`xargs` with spaces in filenames

I'm trying to list only non-image files, searching only in the most recent 500 files. So I run ls -t | head -500 | file | grep -v 'image' which isn't right: it displays a help message. Changing it ...
2
votes
1answer
48 views

Shell Scripting: Deleting or moving files from one directory that match filenames from another directory

I have a very specific and odd problem to solve. I'm working as a research assistant and I've been producing a ton of figures. In one directory, I dump .pngs to view casually (limited space here) and ...
1
vote
3answers
78 views

Rename files (delete some characters that are not always the same)

I have some files named like this : DA1_ATGCATG_L001_R1.fastq.gz Oeu43_TCATGAC_L004_R2.fastq.gz I want to delete the part after the first "_" but keep the end of the names from "_R" to obtain this ...
1
vote
1answer
59 views

Need a shell script for copying files that have long and out of capacity names

I have a directory on a NTFS file system which contains files with short and long names, I entered copy command for that directory to be copied on a Ext2 file system, files with short names copied ...
1
vote
3answers
115 views

How to copy lines from multiple files into one new file and keep file name?

I have 81 files in .fasta format that contain (up to) 53 items. Such as: /User/MyData/Sample_1.fasta /User/MyData/Sample_2.fasta .... /User/MyData/Sample_81.fasta Each .fasta file contains a name ...
0
votes
2answers
16 views

A file containing exports

I have a file containing the following: export PYTHONPATH=/home/myuser/squish-5.0-xyz/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/myuser/squish-5.0-xyz/lib I don't what to place it in my ...
2
votes
2answers
86 views

how to strip the last slash of the directory path?

I have a script which requires an directory as one argument. I want to support the two form: one is like a/b/c (no slash at the end) and another is like a/b/c/ (has slash at the end). My ...
0
votes
4answers
137 views

Foreach loop for ls output

I am trying to process some files in directory using foreach loop for ls output: IFS=$'\n' for i in $(ls -1Atu); do echo "$i" done At first time i thought it works, but when i created file ...
9
votes
1answer
379 views

How do case-insensitive filesystems display both upper and lower case file names?

This question occurred to me the other day when I was working on a development project that relies on an opinionated framework with regard to file names. The framework (irrelevant here) wanted to see ...
1
vote
1answer
49 views

How to change configuration of detox (dash instead underscore)?

I found, best to this moment, a solution when changing all those annoying filenames in large quantities, making them readable and easier to manipulate with in command-line. So I found, among many ...
4
votes
2answers
433 views

Location of the crontab file

as many (most?) others, I edit my crontab via crontab -e, where I keep all routine operations such as incremental backup, ntpdate, various rsync operations, as well as making my desktop background ...
2
votes
1answer
52 views

Bash completion - How to get filename completion for suboptions

I have a function which can take main arguments and then sub-arguments. Some of these sub-arguments are filenames. The current completion code I have is as follows. _scm() { local cur prev opts ...
28
votes
2answers
845 views

find(1): how is the star wildcard implemented for it to fail on some filenames?

In a file system where filenames are in UTF-8, I have a file with a faulty name; it is displayed as: D�sinstaller, actual name according to zsh: D$'\351'sinstaller, Latin1 for Désinstaller, itself a ...
1
vote
2answers
283 views

Why do I have double slash here?

$ which mycommand /home/t/program_files/document/other edits//mycommand Why do I have double slash // here?