Questions tagged [directory]

A file system structure in which to store computer files.

Filter by
Sorted by
Tagged with
0
votes
4answers
37 views

Changing to a frequently used directory easily

Every time I need to go to a new directory I give the command cd and the name of the directory and ls to see the contents inside it. Is there any method or command to directly go the directory of my ...
0
votes
0answers
23 views

How can I make a dummy directory tree with dummy files that contain realistic data?

I'm looking for preferably a one-liner that drops a directory tree a few layers deep with files that contain "realistic" data, as in, not /dev/zero nor /dev/urandom. Data that noticeably ...
0
votes
2answers
23 views

Linux root directory and partition

I am having a problem trying to figure out this problem in my head. We say that the Linux file system has only one root directory. Supposing we have more than two partitions on our computer, how can ...
0
votes
0answers
17 views

Trying to remove directories below a certain size, and they won't delete

I'm using the below command (in a script on a Synology NAS) trying to remove all folders under 100MB, and while the first part of the command can properly display them, adding the xargs rm doesn't ...
4
votes
2answers
149 views

sort directories by last modified content (recursive)

I have a bunch of directories at the same level and would like to sort them according to the last modified date of the content (recursive) inside them. However, in nautilus, it looks like the ...
-3
votes
2answers
38 views

Add a directory to path

I would like to know how to add a directory to path (such as my Downloads folder) so that whenever I type cd Downloads from whatever directory, I go to ~/Downloads.
0
votes
1answer
38 views

How does the getdents() system call work internally?

I recently began studying Linux's source code in order to create my own POSIX operating system from scratch. From what I understand, everything on a UNIX-like system is a file. Anything that you can ...
0
votes
1answer
52 views

How to retrieve folders name in a directory with bash

I'm trying to get the names of the folders inside another folder. I was trying to use the bellow code but the problem is that it return the full address of the folder instead of just the folder name ...
0
votes
2answers
60 views

awk: find the oldest and newest files by date

I'm using an awk script to print the oldest and newest files created based on the date (the 6th 7th and 8th field). my sample list, date in the format (YYYY/MM/DD): file was created 2020/10/10 20:18:...
0
votes
1answer
69 views

Testing if file/ directory is in a specified directory in bash [closed]

My program has 2 arguments $fileordirectoryname and $directorypath. I am trying to test whether both arguments are in the same directory. How would I do so in bash script? #check if both arguments are ...
0
votes
1answer
25 views

du result of directory larger than sum of files in that directory

use du -a in a given directory, but the disk usage of directory is larger than sum of all file's disk usage in that directory. why is that? From the man page, I assume that du command return the disk ...
-1
votes
0answers
15 views

Change software root directory Linux

I am working with some PLC and on it is a Linux. I struggle with lack of space on internal memory. I figured out how to connect SD card, but i really do not know how to change opkg install directory ...
0
votes
2answers
13 views

creating a directory tree on a remote machine with a specific group ownership

I just struggle with the problem that I want to create a directory tree on a remote machine in which all directories have a certain group ownership. Furthermore, I explicitely want to have parent ...
0
votes
0answers
48 views

execute all files under a directory

Im trying to use find to execute all the files under a directory. I have a sed script that will replace all # with //. assume my directory is /path/to/directory and it contains file1 file2 file3 using ...
0
votes
1answer
50 views

Recursively renaming folders to @eaDir

I'm trying to use a thumbnail generator python script I found on GitHub, which works awesomely. It generates thumbnails in a folder called eaDir_temp, which then needs to be renamed on the NAS to @...
1
vote
1answer
56 views

I have extracted a tar file in the wrong directory

I have extracted a tar file in the wrong directory, and this tar file extracted 200 files. I cannot remove everything from the directory because there are 10 files that are sitting in the directory, ...
-2
votes
2answers
39 views

How can I block ~ symbol when I'm on /home/user directory?

I want to block ~ symbol when I'm in /home/user directory. I want this because I'm trying to make my Linux system look like Windows 10. My current prompt look like C:~/> I want to make it look ...
1
vote
1answer
46 views

Why inode numbers of /dev and /run are same as that of /? [duplicate]

Please see below output: In below output, the inode numbers of /dev and /run are same and equal to 2. The inode numbers of ./ and ../(could be a special case as ../ should point to ./) are also 2 and ...
-1
votes
2answers
31 views

How to check if one or more file/s (directory /ies) exist with Bash?

In CentOS with Bash 3.2.52(2) I try to create two backup directories after ensuring they did not exist before: rm -rf "${general_backups_dir}" rm -rf "${specific_backups_dir}" ...
0
votes
1answer
27 views

block a folder, so that a wine installation/update does not change the content of the folder

I use a debian based linux distribution. My file system is ext4. I also have installed wine. I have made changes in the folder "/opt/wine-staging/share/wine/fonts/". What changes did I made? ...
0
votes
1answer
23 views

How to create nested folders (start with .) properly?

I want to create the nested folder .aa/.bb in the current user root's home directory. So I use the command mkdir -p "~/.aa/.bb/". But it doesn't work as I expected and it created a folder ~, ...
0
votes
1answer
20 views

Recoll: Removing directories from Xapian db after indexing

Directories can be excluded from Recoll indexing with the parameter skippedPaths in recoll.conf. Does this remove the skipped directory data from Xapian db if the directory was indexed earlier? If it ...
3
votes
1answer
116 views

What does the '.' dot mean as a working directory?

I'm not referring to the . you see in shell commands or in the output of ls -a. I just ran an install script for a vpn application, and after the command exited, my terminal prompt was in the . ...
0
votes
5answers
192 views

How to find directories where certain files exist but some others don't

Let's say I have lots of directories for reports and I always have a report.md file in directories with reports but report.pdf only in finished reports. I want to find directories where report.md ...
0
votes
1answer
104 views

Can I remove all the recent kernel versions at /lib/modules/

I saw that in /lib/modules/ I have 7 directories that related to the out of date kernel versions, can I fully delete them? It will not make any changes or hurt my system? $ ls /lib/modules 5.4.0-26-...
-1
votes
1answer
65 views

Is it possible to remove directory permission `d`

I know about Everything is a file (Wikipedia). While I was playing around with file permissions, I've wondered if it's possible to change a directory file type into a plain regular file type. eg: ...
1
vote
4answers
51 views

Taking a File Argument and Moving to That Directory? [duplicate]

Is there a Unix command or shell script that takes a file argument and moves to the containing directory, ignoring the file part of the argument altogether?
1
vote
1answer
51 views

Distant access to /home directory using bind or symlink

I have a hard drive Data(FAT32) and I want it to contain my /home/username directory and its content so that the /home/username directory is 'artificial'. I have attempted to : use symlink (ln -s /...
0
votes
0answers
37 views

Bash: remove spaces in directory name [duplicate]

!! This question is not about SHELL, it's about BASH, can't change the faulty tag !! I've got a code that removes the spaces in directories and filenames (and inserts a dot); find $jdir -depth -name &...
0
votes
1answer
42 views

Omitting/filtering dirs from find output

find /home/alex/devops/backups/ -maxdepth 1 -type d -mtime +60 Outputs : /home/alex/devops/backups/ /home/alex/devops/backups/R8.1 /home/alex/devops/backups/R11.0 /home/alex/devops/backups/R.16.2.1 ...
0
votes
1answer
75 views

mkdir “No such file or directory” within a directory that exists

I have a network (samba) share mounted at /run/user/1000/gvfs/smb-share:server=wdmycloud,share=family. Most activities work fine within the share - I can move stuff around, create and delete files, ...
0
votes
1answer
23 views

Why is size of a directory different even though both of them have same contents?

I have two VM identical in terms of resources. Can someone explain to me why the below directory size is different even though both of them have same content? VM1 root@vrni-platform:/usr/share/...
0
votes
1answer
217 views

Zsh: How to create a directory and file inside it with one command?

I am curious whether it is possible to create a directory and file inside this directory with one command, similar to mkdir -p but for a text file and intermediate directory. I read through the touch ...
0
votes
1answer
20 views

Why do I see different files/folders when open desktop with terminal “li -a” vs desktop + “cmd+shift+.”?

When I run the terminal and type "ls -a", and what I see is a lot of additional file starting with a dot as it is supposed to be: However, when I try to visualize the hidden files with ...
2
votes
2answers
57 views

How do I delete all directories with a certain file type in them?

I'm writing a command line script to 'unpack' folders with .svg files from downloads. I've copied the required files to a specific directory and now I need to delete all the directories with .svg ...
1
vote
4answers
81 views

rm -rf with missing w permissions on directories without root or chmod

I'm trying to recursively delete a directory with rm -rf, but this fails because some inner directories don't have the w permission set. I know how to fix this with chmod. However, this requires to ...
1
vote
2answers
53 views

How to find directories (or files, etc.) based on an expression that applies to the file pathname [duplicate]

I'm trying to find/extract directories based on an expression that applies to the file path. For example, I used the command: find . -type d -links 2 To get a list of directories that looks something ...
1
vote
2answers
50 views

Copy file recursively to all deepest subdirectories

I'm trying to copy a single file to all of the deepest subdirectories in a tree structure. Imagine it looks like this: bar dir1 | | | +--dir2 | | | +--dir3 | +--dir4 | | | +--...
0
votes
1answer
13 views

Dealing with multilevel permission on RHEL server

Right now, there is a mounted NFS storage on RHEL server at the following location: mnt/NFS/Data So I had to request read, write, delete permissions inside Data directory from the server admin. After ...
0
votes
1answer
18 views

Create mountable device /dev/sd originated of a directory

From a directory how can we create mountable device /dev/sd... (as if usual partition) so simply a virtual device of a directory, by use of command line ? All must be by script/command line
1
vote
1answer
54 views

find . - exec rm -rf {} and strange messages that the files were not found [duplicate]

I have a script for creating backups and deleting old backups. It has this line: find . -type d -mtime +29 -user admin -name "20*" -exec rm -rf {} \; This way, directories with backups ...
1
vote
1answer
28 views

Loop through directory with space in the name

I am trying to write a script that will loop through directories, and rename the file in the sub directory to match that of the directory name. I am running into an issue where if a directory has ...
0
votes
2answers
41 views

How to make sure directory only has specific subdirectories?

I have a directory that has some subdirectories with files in them. I have another directory that has very similar subdirectories but there may be a few that are added or removed. How can I add and ...
-2
votes
2answers
81 views

How can I delete all the files that end with “2”? [closed]

I accidentally copied two times the files of a backup, so now I have got two identical files, the only difference is that one of two terminates with a space followed by "2". Example: urh 2....
0
votes
0answers
18 views

How to make NGINX directory editable?

So I dowloaded nginx and I see I can't make modifications to the folder i.e I want to change the nginx.conf file but I don't have the permissions to do so. I get Error setting permissions: Operations ...
0
votes
1answer
42 views

Immediately redirect output of a program to a different directory

Normally, I call a program from inside $path_to_program, which accepts an initialization file. Basically, how I run it is ./program file.in. After the program starts, it creates some binary output ...
2
votes
1answer
171 views

Why does 'cp -r ../* .' work but not 'cp -r .. .'

If I have the tree: . ├── child ├── dir1 ├── dir2 ├── dir3 ├── file1 ├── file2 └── file3 This is the result of issuing these commands within child: This works and copies all files and directories: cp ...
0
votes
0answers
33 views

Size discrepancy between “ls” and “du” calls

We are constantly low on space and look for files are installed programs in /tmp on out server. I notice the following for tmp but can't find a large file in /tmp. drwxrwxrwt. 27 root root ...
0
votes
0answers
13 views

Where can I find the cache of the configuration files that usually reside in ~/.local/share/kxmlgui5? (KDE 5)

I mistyped and deleted the directory ~/.local/share/kxmlgui5. My machine is still running and nothing is broken so far, so assume the configs from that directory are cached somewhere. Does anybody ...
2
votes
1answer
46 views

Prevent mv from moving target folder

If symbolic link bar points to folder foo, then the two following commands have very different behaviors: mv bar baz # rename link 'bar' to 'baz' mv bar/ baz # rename folder 'foo' to 'baz' (...

1
2 3 4 5
32