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

learn more… | top users | synonyms

0
votes
2answers
37 views

Does soft linking a directory hard link its subfiles?

Suppose I have the following configuration: Folder A file1 file2 I then create a soft link of Folder A as follows: ln -s A B so that we now have: Folder A file1 file2 Folder B ( symlink of ...
2
votes
1answer
20 views

How can I delete a former MTP directory, which now gives me input/output error whenever I try?

I have ~/srv/mtp, which I do not remember how I created. It was back when I was trying to set up a MTP mountpoint using various tools for that. Currently I can't do anything to the directory. ○ file ...
2
votes
3answers
140 views

How to search for text within compressed files and get just the files name

I'm trying to find just the files' names which contain an specific string. The files are compressed (.gz). I don't have zgrep installed and can't install it. Therefore I can't use the -l option. ...
7
votes
2answers
720 views

Is it possible to fake a specific path for a process?

I'm trying to run ADB on a linux server with multiple users where I am not root (to play with my android emulator). The adb daemon writes its logs to the file /tmp/adb.log which unfortunately seems to ...
1
vote
1answer
26 views

Scan though directory of files and find replicates with same name and concatenate them into one file

I have a directory with a bunch of files For example: ExperimentA_Rep1.bed ExperimentA_Rep2.bed ExperimentA_Rep3.bed ExperimentB_Rep1.bed ExperimentD_Rep1.bed ExperimentC_Rep1.bed ...
3
votes
3answers
110 views

Why are square brackets preventing shell expansion?

'4800483343' is a directory, and 'file1' & 'file2' are two files in it. Why is the following happening? $ ls 4800483343 file1 file2 $ md5sum 4800483343/* 36468e77d55ee160477dc9772a99be4b ...
5
votes
4answers
272 views

How to find missing files with sequential names?

I have thousands of files named 1.txt 2.txt and so on. Some of those files are missing. Which would be the easiest way to find out which files are missing?
3
votes
3answers
117 views

Using basename to strip file extension and search for files with the same name

Basically, I have a folder /test/ that has a number of files of type .doc and .pdf. Some of the files have a .pdf and a .doc version, such as test.doc and test.pdf while others only have one version. ...
0
votes
1answer
138 views

SED find and replace element in filename with incremental values

A sample filename is Sample-0.0.1-SNAPSHOT.jar (result of a maven build in jenkins). My goal is to run a shell script that executes on failure and what that script does it adds incremental numbers to ...
3
votes
2answers
100 views

How can I remove files which contain special characters and Latin-1 characters?

I have 2 files in a directory named App on my Ubuntu mahcine. I want to remove those 2 files completely from that directory, but when I try to remove them using rm -rf, they are not deleted. I can't ...
2
votes
1answer
137 views

Using rename command to rename first part of a file

I have three files in a directory (in mac-osx terminal) say INIT_Struc1 INIT_Struc2 INIT_Struc3 which I need to rename as FINAL_Struc1 FINAL_Struc2 FINAL_Struc3 When I use the rename command ...
2
votes
2answers
84 views

Remove specific (known) extension from filename if it's there

I'm not even sure whether grep is meant to be used for regex in one-line data. Googling led me to this lookahead expression that, along with grep, matches any .ext file and returns bare name: ...
3
votes
2answers
442 views

Regex file name with multiple digits

Say I have the following file: test_file-1234-master.tar.gz I have tried to un tar using the following commands tar -xf test_file-[0-9]+-master.tar.gz tar -xf test_file-[:digit]-master.tar.gz ...
3
votes
2answers
146 views

How are log files named?

Or what can we infer from the names of log files? For example, when I want to check the Xorg logs, I find three files: Xorg.0.log Xorg.0.log.old Xorg.1.log You can also find many such log ...
0
votes
1answer
28 views

Find filename using list inside a file

How can i find all filenames that match a string in a list inside a file? I have a list_file.txt with a list of email addresses each in a new line like this: 1@mail.com 2@mail.com 3@mail.com ... ...
0
votes
1answer
1k views

Using a relative path? I know the absolute path. Using copy command? [closed]

I have a lab I am doing for a Linux Operating class. The question I am stumped on is: For the following questions, only use the cp command to copy files. You should currently be inside your ...
2
votes
1answer
61 views

To which files does the key stroke and mouse click data go first and what form they have?

I want to know which files belong to keystrokes and mouse clicks, and what kind of data is sent to them. My main purpose of asking this question is key logging. I want to write a key logger script ...
1
vote
1answer
174 views

What characters are valid to use in filenames? [duplicate]

I seems like it is possible to create filenames in unix with just about any valid character. touch \; && touch \\ && touch \" && touch $'\n' && touch $'\t' && ...
3
votes
1answer
172 views

How does Linux detect mime type? [duplicate]

I have a PDF file with extension .pdf. If I remove .pdf - the file is still recognized as PDF file ($ file sample - output sample: PDF document, version 1.4.) What is the mechanism of filetype ...
0
votes
1answer
12 views

Obtain filepath of directories containing a particular filetype in alphabetical/numerical order [duplicate]

I have a directory that contains 800 subdirectories named disp-001 ... disp-800. All these sub-directories need to contain a specific file say stdout. One among them does not contain the file and I ...
5
votes
1answer
490 views

Untar filenames in a character encoding different from encoding used in the filesystem

I occasionally get tarballs where the filenames are encoded in ISO-8859-1 or some other pre-Unicode scheme. My system uses UTF-8, so when I untar these archives with the usual options (tar xvf ...
0
votes
2answers
78 views

File System that supports duplicate directory names

Is there a file system that supports duplicate directory names. Ideally to distinguish between directory names you would use indexes(file directory order). This is related.
5
votes
1answer
97 views

Using File Date/Time as Metadata: Reliable?

Background: I have groups of files in their own directory which I merge into one file in order of their filename. I call them t1.txt, t2.txt, t3.txt... I merge them in order of the integer. ...
0
votes
4answers
112 views

How can I test for the .RAW file extension?

I'm trying to set up an sh script that will run every 30 minutes. During each run, I want to check a directory for the presence of at least one .RAW file. Upon finding that file extension, I will have ...
0
votes
2answers
64 views

Putting a single quote in a filename [duplicate]

We can a make a directory named $"dollars"&<>\dogs if we surround it with single quotes like the following mkdir '$"dollars"&<>\dogs' However, what if I want to include a ...
4
votes
4answers
891 views

Null and escape characters

I know that a filename in Linux has no restriction whatsoever except for two characters '/' and '\0'. I know that '/' is prohibited because it is a directory separator but is there any other reason ? ...
0
votes
2answers
43 views

Why do compiled programs create a copy with ~?

Why is it that when I run programs for the first time it creates a copy of that file with a ~ at the end? For example, a file like HelloWorld.lua when run would create 2 files: HelloWorld.lua and ...
2
votes
2answers
102 views

What other special characters are there?

For filenames, I know that you have to use either a double quotes or a backslash to include a space in your file name. Like mkdir "I like coffee" is the same as mkdir I\ like\ coffee Now when you ...
2
votes
2answers
78 views

Why are certain naming conventions so inconsistent in Linux? [closed]

It seems like the general pool of logging, changelog, readme, and config files in Linux is very inconsistently named. It always makes me wonder, why didn't *nix devs decide on a common file name ...
35
votes
7answers
3k views

Is `~/Documents` a relative or an absolute path?

This is merely just a vocabulary question, but which keeps turning around in my head. It comes from a practice exam from a LPIC preparation book. The correct answer according to the book is that ...
-2
votes
1answer
106 views

how to delete swarm of ._ files using commandline

I have these files in MAC which have weird ._ character before filenames/folders. Which I want to delete in one shot. Is there a way to do it in commandline? eg. ._js ._css ._image if I go into ...
0
votes
1answer
198 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
138 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
158 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
355 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
48 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
60 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 server. Sftp processes the files, and moves it to another tool, by appending the file size at the end of the file name. For ...
2
votes
2answers
109 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 \ ...
4
votes
3answers
987 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
65 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
62 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
135 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
155 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
116 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
450 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
381 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
158 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?
22
votes
9answers
7k views

Find files whose name is 4 characters long [duplicate]

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
941 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
117 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 ...