Questions tagged [directory]

A file system structure in which to store computer files.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

How to use rsync correctly to compare file hashes of two directories incl. subdirectories and interpret its output?

To check equality of a local and a remote directory I want to compare the hashes of all the files and did: $ rsync -avcn /home/me-here/thisss/ me@other.server:/home/me-there/thisss/ > diffs.txt ...
1
vote
1answer
46 views

Editing a file without it being executable

I have a file secretinfo.txt inside a directory SensitiveData that I am trying to edit. Currently, the directory and file have the following permissions: drwx------ 2 www-data root 4096 Apr 20 17:39 ...
0
votes
0answers
18 views

Changed .dir_colors but nothing happened

I didn't like my directory colors, so I changed my .dir_colors file. After saving the file, nothing changed.
0
votes
2answers
33 views

How to trim off specific parts of multiple directory names?

I have 100 directories within a parent directory (/home/anik/"all my directories") with the following naming structure: Zt.isolate1.Spades Zt.isolate2.Spades Zt.isolate100.Spades I want to ...
0
votes
0answers
8 views

I am trying to install MCScanX-transposon but it says makefile not found

I am trying to install MCScanX. MCscanX was installed successfully but I am getti9ng error while installing MCScanX-transposon. When I write make, it says no target specified. I also tried ./configure ...
-4
votes
1answer
23 views

i want to make 10 directories and file in each directory using while loop [closed]

I want to make 10 directories and in each directory there should be a 1 file how can i make such code using while and for loop.
0
votes
3answers
38 views

Print number of files excluding directories [duplicate]

I learned that 'ls | wc -l' command prints number of files in the current directory, but it includes all files and directories. Can I do the same task only for pure files excluding directories?
0
votes
1answer
51 views

How to change the extension of all files from a directory?

I am using Linux and I want to write a shell script that takes two directories and moves the second directory in the first one (so the second directory becomes a subdirectory of the first one) and all ...
0
votes
1answer
58 views

How to make a directory really undeletable?

I'm using this commands to make DIRECTORY undeletable: sudo chmod 000 DIRECTORY sudo chattr +i DIRECTORY But I can delete it using this commands: sudo chattr -i DIRECTORY sudo rm -rf DIRECTORY How ...
0
votes
2answers
50 views

Creating symbolic link in the same directory

Having some trouble with creating links. I want to create the following: ls -la /usr/pkgs/python3/ total 44 drwxr-xr-x 5 root root 4096 Sep 3 2020 . drwxrwxr-x 259 root root 20480 Feb 16 06:49 .. ...
0
votes
2answers
60 views

Difference between owner and group

Can we consider the owner as a group that has exactly 1 member? Does the owner have any special abilities apart from the given permissions? I want to have two equal users with the same permissions in ...
0
votes
1answer
28 views

How to affect only files who only have paths within a directory?

If i understand it correctly, in linux, a file can have an arbitrary number of paths. Suppose some user wants to change permission of their /home/<user> files so that all their files can't be ...
0
votes
2answers
34 views

How can the original /home directory be access from the root directory when the /home directory is transferred to a new volume?

I created a separate partition for the /home files and copied the existing files to the new partition but I did not delete the original directory. When I restart the system the / directory does not ...
0
votes
0answers
15 views

Generate shell script which eliminates differences between two directories

I would like to compare two directories and then generate shell script which turns "target" directory files with "source" directory files. It should copy the changed files from ...
0
votes
3answers
35 views

Directory listing when using setfacl ACL

I use setfacl command to grant read permission for reading files in directory, but I cant use ls to view files. I tried setfacl -Rdm g:grouptoadd:rx /path/directory/ but, I can read files (when I use ...
1
vote
0answers
28 views

Counting directories based on access

I need to get the number of directories that Can only be read and opened by the owner of the directory. Can only be opened by their group. My current solution is this: ls -la . | grep "^dr-x--x-...
0
votes
1answer
42 views

Concatenating files from a directory using cat gives “No such file or directory” error

I have some files in a directory A. From another directory B, I want to concatenate them in one single file. I use the command line cat like cat path_A/* > my_file_output I have an error that say ...
1
vote
1answer
47 views

How can I delete these strange “ghost” folders? (Raspbian)

I bumped into a strange issue. I run a torrent box on a Pi 4 with Raspbian Buster. I use Transmission daemon and Transmission remote client. I deleted a couple of torrents-folders via the remote ...
1
vote
0answers
50 views

How can I restore a deleted directory entry on an ext4 file system?

I was in the process of doing a fsck on an ext4 filesystem on my NAS, where it hit a hard error and quit (unfortunately I've since lost the error message). When I remounted the volume right after to ...
0
votes
1answer
24 views

Path prefix to remove start of suffix

I have a program that wants to look for library files in a subdirectory of the directory I specify with an environment variable. Is it possible to put in my specified directory a path that ignores the ...
0
votes
0answers
40 views

Size of directory with millions of sub directories without `du'

I have a folder with millions of sub directories and in each sub directory a file. I need to get the size of the complete directory size. I've used du but it took 17 hours (on a M.2 SSD) to complete ...
1
vote
1answer
41 views

Directory traversal to root or home from any location

Param is my input, which is added to the cat command so basically eval "cat /a/really/long/path/idk/how/long/$param1" on changing the param1 to something to something else can I access the ...
-2
votes
1answer
26 views

How to recursively list subdirectories and their sizes?

I have a directory with many subdirs and many files inside those. All I need is to figure out how much space each subdir takes. So I need something like ls -lR in that I want to see the entire ...
0
votes
2answers
26 views

Batch rename folders appending fixed text and moving part of the name

I have several directories named in the pattern [year] name, like [1900] aaaa, [1901] bbbb, [1902] cccc, and so on. I'd like to append a fixed text - to the beginning of the name and move the [year] ...
0
votes
3answers
50 views

Move multiple files to subdirectories in linux

I have a directory structure like this; dir ├── dirA │ └── file1 │ └── subdir └── dirB └── file2 └── subdir I need to move file1 to dirA/subdir and file2 to dirB/subdir. How can I do it ...
-1
votes
1answer
41 views

How to change all files in directory creation/modification date to 0/0/0?

I want to change all files in directory creation/modification date to 0/0/0. I tried to use find $PWD -exec touch -m -d '0/0/0' {} + command.
0
votes
1answer
18 views

Change the position of a word in directory name

I have several hundred directories currently in this form : Band Name - Album Name (year) I would like to rename everything (with a mass treatment) in Band Name (Year) Album Name Almost all of my ...
0
votes
1answer
28 views

How to remove files having the same name of subfolders in a different folder?

I have 10k files into a folder (folder_A). A second folder (folder_B) contains 100k subfolders. Some of the subfolders have the same name of files into folder A. Here is an example: ls ./folder_A aaa....
0
votes
0answers
29 views

Pinning a Directory to Your Home Directory (~/)

I am very new to Linux and I have done this before but I cannot find the code. I have a folder I made under my desktop ckhui@DESKTOP-8MRJ575:/mnt/c/Users/Cassandra/Desktop$ mkdir BioInfo I want to be ...
-1
votes
1answer
32 views

Programatically create folders with names based on values [closed]

I need to create 10.000 folders named a0_value, where value is read from a .txt file. The .txt file is arranged on 2 columns. It has exactly 10.000 lines. value is always extracted from the 2nd column....
0
votes
1answer
39 views

How to search subdirectories that has only 1 file inside and move the file up one step to the parent directory

So I have multiple subdirectories in which many of them have only 1 file and the name of the filename is the same as the subdirectory name. DIR A --DIR B ----B.zip --DIR C ----C2.zip ----C3.zip --DIR ...
1
vote
1answer
68 views

Alternative to ls | grep [duplicate]

I'm trying to search through the files and directories of a specific folder. For example, I was looking in /usr/bin for my python binaries. To do so, I used ls | grep python. When I did this, I was ...
0
votes
1answer
49 views

Linux - Inherit file permissions from parent directory

I want all the newly created or moved files in a directory to inherit the permissions from the parent directory. For that I did: chown -R myuser:myuser /home/directory/ chmod -R 2774 /home/directory/ ...
0
votes
1answer
47 views

Why does root own the dot dot “..” directory?

I've been using Linux for ages - I practically live in it, but I've never actually thought to ask why root always owns the .. directory. If you chmod the totality of a subdirectory structure to some ...
0
votes
0answers
71 views

Need rsync options for changing permissions of a folder + files together

I give the user the option to enter 3 digit number for permission say 775 I use ansible where I provide rsync_opts: --chmod:F775 (synchronize module) to change the permission of the transferred file ...
1
vote
2answers
73 views

rsync - What is the difference between using * and ** in the exclude directive?

Following on from my other question about rsync. I am trying to understand how include/exclude directives use patterns to match against the names of files in a source directory to decide which are to ...
0
votes
3answers
131 views

rsync only certain files types from specified sub-directories

Here is my source dir structure: ../openwrt ../openwrt/BackupOfPackages ../openwrt/BackupOfSettings ../openwrt/BackupOfImages I want to use rsync to mirror that to the destination dir. I only want to ...
0
votes
1answer
35 views

Unable to extract entire tar to a particular directory in solaris

I wish to extract /tmp/moht/104.tar to /tmp/moht/ directory ls -ltr /tmp/moht/104.tar -rwxrwxr-x 1 meadmin meadmin 933498880 Jan 5 07:03 /tmp/moht/104.tar I tried the below commands, but it ...
0
votes
1answer
22 views

recursively delete all files+folders except a specific one file in solaris

The below command recursively deletes all but 104.tar file under /tmp/CURRENT folder. find /tmp/CURRENT/ -type f ! -name '104.tar' -exec rm -rf {} + It however, does not recursively delete any sub-...
0
votes
1answer
20 views

How to make multiple NFS host directories appear as one on NFS client?

I have 6 Ubuntu VM's on one network. Five of them has 2 TB disks attached. I have created NFS directories for those disks and share them on the last VM that acts as a client and a server. How I can ...
1
vote
0answers
16 views

Don't let user remove self-created shared directory

I have a group of users, call it group. This group has a shared folder, call it shared. What I want is users of the group to [create and read] [files AND directories] in this folder. And for the FILES ...
0
votes
0answers
7 views

File: /boot/sysctl.conf-4.12.14-lp151.28.87-default

On updating SUSE kernels (Leap 15.1 for instance) the file mentioned in the title is copied into /boot. Q: how is this file generated/created e.g. assembled together? Q: which content is recommended? ...
-1
votes
1answer
60 views

Directory structure for large amount of files [closed]

I have millions of files which filenames are SHA256 hashes of the content. Due to performance reasons I do not want to store them in a single directory. My idea is to have directory structure based on ...
0
votes
1answer
31 views

Accidentally set wrong permissions on /usr

I recently created a new mount point /usb to be able to mount USB sticks to my Fedora 32 Linux system and tried to run sudo chmod a+rwx /usb on a shell, but accidentally mistyped it as sudo chmod a+...
0
votes
2answers
82 views

how to delete all directories in a folder

I want to delete all directories in the download folder. /content/download/documents/ /content/download/music/ /content/download/videos/ /content/download/pictures/ I have tried removing them using ...
0
votes
0answers
123 views

How to completely uninstal HPLIP

I have this annoying popup every time I start my pc and I don't know how to eliminate it and either the HPLIP. I tried this method without success https://askubuntu.com/questions/1056077/how-to-...
0
votes
1answer
39 views

How does rsync distinguish between destination being a local directory with ':' and '@' in the dirname, or a remote SSH? [duplicate]

Technically, we could create a local directory called user@example.com: (it's a valid UNIX path, isn't it?), so how does rsync internally know if: rsync test/ user@example.com:/test/ means: the ...
0
votes
1answer
32 views

How to create multiple directories based on file names and change the file names in linux?

I have a directory AllData with some files like below: AllData |____ file_1to1000.track |____ file_1001to2000.track |____ file_2001to3000.track Based on file names I created directories with file ...
-2
votes
1answer
66 views

Print the number of .txt files in the given directory

I want to print the number of .txt files in the given directory. If a directory have 5 .txt files so the output will be like: 1.txt 2.txt 3.txt 4.txt 5.txt and after that when I check the list, all ...
-4
votes
1answer
45 views

Remove or copy a file all at once

Suppose I have 4 directories : Directory_1 Directory_2 Directory_3 Directory_4 Is there a command line in a terminal Linux I can use to copy a file to all of these directories? Is there a command ...

1
2 3 4 5
32