files

Copy an evenly spaced subset of files

Copy an evenly spaced subset of files For example I have files : file0.txt file1.txt file2.txt …. file100.txt I would like to copy 5 files in bash, which will produce result : file0.txt file19.txt file39.txt file59.txt file79.txt Edit. screwed up counting should be this: file0.txt file20.txt file40.txt file60.txt file80.txt So files are evenly spaced sampled. …

Total answers: 4

Create bootable iso file from rootfs linux files

Create bootable iso file from rootfs linux files I want to make bootable iso file from typical Linux distributive files. I have tried to make grub bootloader, firstly I created template for grub.cfg using grub-mkconfig and I added this configuration at start of it: set default=0 set timeout=5 menuentry "LinuxTest" { set root=(hd0) linux /boot/bzImage …

Total answers: 1

How can I search based on file contents? (GUI, not terminal)

How can I search based on file contents? (GUI, not terminal) Every question and answer I’ve seen so far is ancient or just about grep in the terminal. I want an easy way to search my ~/code folder for certain strings. And I want the interface to allow filtering by file extension, etc. I thought …

Total answers: 1

Confused about command line options for Linux mkfs

Confused about command line options for Linux mkfs I am formatting a new drive on Ubuntu 20.04, and I am at the step where I format the drive to ext4. One article (https://linuxize.com/post/fdisk-command-in-linux/) says to do this: sudo mkfs.ext4 -F /dev/sdb1 The article doesn’t say what the -F option is, and there is no -F …

Total answers: 1

Rename file in Mac OS Terminal using Regex or translate from Windows Script

Rename file in Mac OS Terminal using Regex or translate from Windows Script I would like help with a shell script for macOS to rename files with a certain pattern. The script would handle only one file, not multiple. Here are three examples: a. Public Talks_ (189) Walking With God Brings Blessings Now and Forever …

Total answers: 1

Thunar and ls different file size

Thunar and ls different file size I have a complete android userdata partition image on disk and it shows 48.9 GiB on Thunar but only 3.8 GB in ls and Baobab. How is it possible ? Thanks Asked By: darkon11 || Source This might be a sparse file; i.e. a file that has "holes" where …

Total answers: 1

Regular user is able to modify a file owned by root

Regular user is able to modify a file owned by root If the file is a plain text file created by root with: echo ‘foo’ > ./file.txt Your ls -l is: -rw-r–r– root root ./file.txt But as a regular user, I can change this with vim saving with :w! or with a sed command and …

Total answers: 2

On Ubuntu 22.04, editing limits.conf to increase number of file descriptors doesn't work

On Ubuntu 22.04, editing limits.conf to increase number of file descriptors doesn't work I followed this answer: https://askubuntu.com/a/162230 I edit limits.conf, now it is * soft nofile 65536 * hard nofile 65536 * soft nproc 65536 * hard nproc Unlimited root soft nofile 65536 root hard nofile 65536 Also, I edit both "/etc/pam.d/common-session" and "/etc/pam.d/common-session-noninteractive". …

Total answers: 1

How to move all files whose contents begin with 0?

How to move all files whose contents begin with 0? Here’s a command to move all files whose name begin with 0 into a folder called zero : mv [0]* zero Question: What is a command for moving all files whose contents begin with 0 into a folder called zero? Hopefully, there is a short …

Total answers: 1

Return all files of a specific extension with directory and subdirectories paths

Return all files of a specific extension with directory and subdirectories paths using terminal on MAC OS I need to return path along with the file name in the a directory and all sub-directories, but only if a fie has a specific file extension (e.g. .txt). I tried this, but it does not filter by …

Total answers: 2

Why files are created with different encodings using vi

Why files are created with different encodings using vi When I work with Bash scripts, I always create files using vi. I am debugging a script that in theory is written correcly and I decided to check the files I have created using the file command. This is what I see. myScript1 Bourne-Again shell script …

Total answers: 1

Hard link as destination of cp and rsync

Hard link as destination of cp and rsync Where do I find documentation of behavior of cp and rsync commands when the destination path shares the inode with another path? In other words, when I do $ cp [options] src dest $ rsync [options] src dest and when there is dest2 that is a hard …

Total answers: 1

Can't interact with a file with an apostraphe directly in bash

Can't interact with a file with an apostraphe directly in bash I have a file titled "I’m Here.mp3" when I try to interact with it with ls, cp, mv, anything, it returns cannot stat "./I’m Here.mp3": No such file or directory. I tried double quotes, single quotes, no quotes, each with and without trying to …

Total answers: 1

How could i have certain directories in a removable device?

How could i have certain directories in a removable device? Lets say i want this directory structure on a SD card: SD ├── log -> var/log ├── dbs -> var/db └── desktop -> home/desktop (its just an example) This is so everytime a file goes into /var/log instead it goes to SD/var/log, how could i …

Total answers: 1

How to get the size of a folder as reported by Windows Explorer on Linux?

How to get the size of a folder as reported by Windows Explorer on Linux? On Windows when you view the properties of a folder the size is calculated as follows (recursively): for files the length of the content counts symbolic links count zero folders themselves count zero Is it possible to get the same …

Total answers: 1

Using find in order to detect a magento module

Using find in order to detect a magento module At magento routes are located in adminhtml/routes.xml each module has a folder named adminhtml with a file routes.xml each module has its own folder. In other words I have the following file structure: vendor + MyModule ++ etc +++ adminhtml ++++ routes.xml + AnotherModule ++ etc …

Total answers: 2

How to preserve file creation date when overwriting files?

How to preserve file creation date when overwriting files? When I’m overwriting one file with another one, not only it’s modification time updates, but also birth time, which is unwanted. I want to make Dolphin overwrite files that way, so target’s birth time will stay the same the same as it was before overwriting. But, …

Total answers: 1

Leftover kernel directories with files

Leftover kernel directories with files Why there are Kernel leftovers and can I get rid of them automatically? There are so many kernel directories after a few months, that I get annoyed with it. I just carefully inspected the /usr/lib/modules directory and removed all old kernel directories, but for one, and inspected its actual contents: …

Total answers: 2