Skip to main content

Questions tagged [filenames]

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

4 votes
3 answers
179 views

Get Character Code for Character in File Name

Short version: I am at a bash command line. In some directory, I can ls various files and see their names. I would like to get something like the ASCII character code for each character in a file's ...
ASV's user avatar
  • 43
4 votes
4 answers
429 views

How can I find common prefixes in file names to group them?

I would like to be able to find all files in multiple directories whose file names start with the same string, but preferably not if that string is only one word or contains fewer than perhaps 5 ...
EmmaV's user avatar
  • 4,417
3 votes
7 answers
985 views

How to list only the last name.partXXX.rar file?

In Linux in a folder, without subfolders, there are many files like this scheme. I list them with ls -1. 1yBWVnZCx8CoPrGIG.part01.rar 1yBWVnZCx8CoPrGIG.part02.rar 1yBWVnZCx8CoPrGIG.part03.rar ...
Banana's user avatar
  • 241
1 vote
2 answers
67 views

Ffmpeg generate fixed binary digit filename pattern

Suppose I have filenames like these 4-bit patterns: 0000.ts 0001.ts ... 1111.ts Basically, that file was generated from an RTSP stream that chunks every second. So, for each binary number ...
Muhammad Ikhwan Perwira's user avatar
0 votes
1 answer
67 views

Alias for rm does not include file name with @$ [duplicate]

I am trying to create an alias for the rm command in the /root/.bashrc file on a VirtualBox Redhat VM (running RHEL 9). I cannot get it to work properly. This is an excerpt of my .bashrc file: alias ...
minionsaregreat's user avatar
-4 votes
1 answer
117 views

How combination of find with sh solves problem with filenames

I was directed to this StackExchange post: Why is looping over find's output bad practice? The core issue is that Unix filenames can contain any character except the null byte (\0). This means there ...
Filangieri's user avatar
0 votes
2 answers
138 views

Safely Handling Filenames with Newlines Using find and while read

I want to handle filenames with newlines in a bash script rather than having find "$search_dir" -type f | while IFS= read -r file; do Perhaps something like the following would do it find &...
Filangieri's user avatar
4 votes
1 answer
737 views

How can I remove special non-characters that are not part of national alphabets like faces from filenames, keeping any national alphabets intact?

How can I remove special non-characters e.g. faces, avatars, emojis, symbols that are not part of national alphabets from filenames while keeping any national alphabets intact? e.g. ...
Estatistics's user avatar
12 votes
7 answers
4k views

Idiomatic way of generating a unique filename?

In a script I'm writing, I want to create something temporary on my filesystem, but - it's not in /tmp but elsewhere, and may not be a file nor a directory (e.g. maybe it's a named pipe or a symbolic ...
einpoklum's user avatar
  • 11k
6 votes
1 answer
369 views

Revert filenames after they were garbled by using different encoding

I have a file СМП бваг™вга† The first three letters are proper Cyrllic and the remaining part is mojibake. "Mojibake is the garbled or gibberish text that is the result of text being decoded ...
jsx97's user avatar
  • 1,357
1 vote
3 answers
94 views

Duplicate and rename files with matching names but different extensions in bash?

Is there some simple way to duplicate both .cpp and .h files (or any multitude of extensions) simultaneously in bash, instead of: cp foo.cpp bar.cpp cp foo.h bar.h I'm not looking for shell script ...
BrandonL's user avatar
  • 180
1 vote
4 answers
2k views

How can I get the absolute path of a file deep within a directory?

Here's an example of directory level0 contents in a tree-like format. However, suppose it is huge and contains many files as I am omitting many of them here: $ tree level0 level0 └── level1 └── ...
showkey's user avatar
  • 571
0 votes
1 answer
125 views

unison start the sync from zero when I change the parent folder

I use unison to sync two folders that are in separate computers (via unison command with ssh). If for convenience I happen to change the name of the parent folder, unison start to sync the folders as ...
Andres's user avatar
  • 13
3 votes
1 answer
440 views

Extract a RAR file while automatically truncating long filenames

I have a lot of rar archives, and some of them contain files whose names are too long for the filesystem. When attempting to extract them using unrar x, I will get the error: Cannot create [extremely ...
rer's user avatar
  • 31
0 votes
2 answers
592 views

Why does the "cp" command not work with pasted directory path from "pwd | pbcopy" command?

I ran pwd | pbcopy command in Terminal on my MacBook Pro to copy the working directory to the clipboard. The working directory looks like this: /Users/JohnSmith/PycharmProjects/100 Days of Code - The ...
sjl26916091's user avatar

15 30 50 per page
1
2 3 4 5
82