Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [directory]

A file system structure in which to store computer files.

2
votes
2answers
40 views

How to masquerade a file path as another in Linux

I want to have the file path /var/test appear as /root for the user test123. I don't want them to actually be in the root directory but I want it to appear as being in /root so that they can't tell ...
0
votes
1answer
39 views

Getting find: bad option -o -name abc -o -name xyz when perform search for *.properties excluding set of directories from search [closed]

#!/usr/bin/ksh # ***************************************************************************************** # copy_properties.sh # This script copies *.properties files from all directory excluding ...
-1
votes
3answers
28 views

Mv several file to directory with same basename

I have several files with different extensions and directories with the same basename, like this example. FileA.txt FileA.html FileA.directory/ FileB.txt FileB.html FileB.directory/ FileC.txt FileC....
0
votes
0answers
20 views

cannot permanently delete Xcode.app in trash, not even if with “sudo rm -rf” because directory is not empty?

I run on osx 10.14, and I was trying to delete and reinstall xcode. I have also tried the following in safe mode but have the exact same problems. I moved xcode.app to trash, right clicked and chose ...
0
votes
0answers
35 views

Sort directories before files and underscore first with ls

When using 'ls' i want to sort directories first and then all files AND sort directories/files with underscore first. Here is an example: _folder2 folder2 _file2 file I can sort directories first ...
1
vote
2answers
89 views

Does Linux represent an opened directory in the same way as an opened file?

Linux kernel represents an opened file as an entry in the file descriptor table, an entry in the v-node table, and an entry in the open file table. Does Linux kernel represent an opened directory ...
0
votes
2answers
33 views

How to store backup outside home directory [closed]

I'm using Linux Mint 19 Tara with home folder encryption enabled. Now I want to configure home backups with backup tool, but I don't want to store backup inside home directory. I don't want to store ...
1
vote
2answers
37 views

How to recursively move one file type but only when another file type is also present?

In my directory tree, some subfolders contain both *.flac and *.mp3 files, but other subfolders contain only *.mp3 files. I'd like to move all of the *.mp3 files to another destination (a different ...
6
votes
6answers
335 views

Checking for the existence of multiple directories

I want to check for the existence of multiple directories, say, dir1, dir2 and dir3, in the working directory. I have the following if [ -d "$PWD/dir1" ] && [ -d "$PWD/dir2" ] && [ -...
2
votes
2answers
40 views

how to find the real path of folder with regular expression

presto is distributed SQL query engine , and when we installed the presto then it should be created the following home folder /application/DB/presto/presto-server-0.216 so we can say that in ...
0
votes
3answers
35 views

Move or rename subfolders

I have a folder structure like this: /ms/files/a/ /fb/files/a/ /db/files/a/ It should be like this: /ms/files/b/ /fb/files/b/ /db/files/b/ I can find the folders I need to move or rename using ...
0
votes
1answer
15 views

How can I use SFTP to transfer a directory to my local PC, but make the transfered directory have a different name on my local PC?

I'm going to do a reinstall on my laptop and want to backup my .config. But the issue is that when I tried to do it I think it replaced my desktops .config because they both have the exact same path.(...
7
votes
0answers
71 views

Strange case of truly invisible file (?) and undeletable directory on macOS [migrated]

I'm having issues deleting a directory on my macOS Mojave 10.14.3 system. The filesystem is APFS and these are the symptoms: $ rm -rf strange/ rm: strange/: Directory not empty $ sudo rm -rf ...
0
votes
2answers
21 views

Copy specified subdirectories

I have a bunch of folders in an external HDD and I want to copy a part of them. The folders have the following structure: A001A A003A A004A etc... ...and all the folders contain similar directories ...
5
votes
2answers
599 views

Why is the size of a directory either 0 or 4096? [duplicate]

$ ls -l total 28 drwxrwxrwx 1 t t 4096 May 8 2018 dir1 drwxrwxrwx 1 t t 0 Mar 12 2015 dir2 drwxrwxrwx 1 t t 4096 Jan 17 2014 dir3 drwxrwxrwx 1 t t 4096 Jun 12 2017 dir4 drwxrwxrwx 1 t t ...
-1
votes
2answers
101 views

bash: cd: <path> : No such file or directory [duplicate]

I upgraded to the latest version of Kali Linux and all of a sudden I can't open up files. The file manager shows the files exist and I can get in them through the file manager but cannot do so through ...
0
votes
1answer
28 views

Trying to save a photo with python, but when I execute the program with the terminal, It returns that there is no such directory [closed]

I have been trying to execute this program: 1 import PIL as pillow 2 from PIL import Image, ImageFilter 3 photo = Image.open("index.jpeg") 4 b = photo.filter(ImageFilter.BLUR) 5 b.save("/home/...
2
votes
0answers
27 views

Other has permissions with umask 007 on VM with mounted folder

One thing that's odd to me right now is I am playing around with permissions. The way umask works to my knowledge is it basically tells what permissions u g o don't have using octal representation (...
1
vote
0answers
30 views

Make bash understand I want to complete a directory name after “cd”

How to get bash to auto-complete cd commands only with directory names and ignore filenames (just as CMD on Windows) Example: I'm in /some/folder/ I have -rwxr-xr-x filesharp -rwxr-xr-x ...
1
vote
0answers
20 views

fstab bound folders show as disks in GUI

I'm trying to mount different folders on sda7 in the folders in the /home folder. like documents, pictures, and music. I always did that like this: /media/betty/Tuinhuisje/Betty/Documents /home/...
2
votes
2answers
54 views

Is it possible to detect file or folder creation/deletion in real time?

I want to monitor file or folder creation/deletion instantaneously, is it possible? EDIT:I am using Ubuntu 16.04
-1
votes
1answer
48 views

How to switch to the last added folder in that particular folder in S3 bucket

I have a **S3 bucket in which starting of every month ... will be added. And in the month lder daily **new files will be added .
0
votes
1answer
49 views

Who owned the directory and how to remove it?

ls -l /media/debian9/disk total 1741 drwxr-xr-x 2 100000 100000 3 Jul 20 2018 acct -rwxr-xr-x 1 100000 100000 1102 Jul 20 2018 anbox-init.sh Who is the 100000? cat /etc/passwd |grep ...
0
votes
0answers
29 views

E: Opening configuration file ertificates - ifstream::ifstream (2: No such file or directory)

If I try to launch apt-get -y install libfontconfig libxtst6 screen xvfb libxcursor1 ca-certificates bzip2 psmisc libglib2.0-0 less cron-apt python iproute2 dbus libnss3 libegl1-mesa x11-xkb-utils ...
0
votes
1answer
49 views

How do you install a package to a directory?

I am a Debian user. Configuring different servers using Debian distro. I am trying to install packages that locate into my /usr/ directory. How do you install packages to the /usr/ directory? I ...
3
votes
1answer
99 views

Failed to activate systemd-timesyncd.service

I've scanned all forums and questions and found no working answer to my problem. The Network Time Synchronization service doesn't work. The timedatectl service seems to work just fine without it ...
3
votes
2answers
36 views

Creating numerous ranges or blocks of folders/directories?

[EDITED to reflect answers below] I am looking for a way to create blocks of folders / directories from the command line or a script that will generate a top level folder titled "200000-209999" and ...
1
vote
1answer
43 views

Directory owned by a group that doesn't exist? [duplicate]

I'm witnessing a a directory which has for group owner "1002" ... However I do not have any group with such ID (verified with getent group | grep 1002 ). Even history | grep groupadd gave nothing. ...
0
votes
1answer
90 views

AWK- script which lists number and weight of all files created in certain month [closed]

I need to write a script in AWK which will count all the files and their weight in "/home" directory from all the months and display the list in terminal. The output should look like this:
0
votes
0answers
12 views

How to rename ISPConfig directories set by chattr command

I would to import a restore of a web directories to /var/www/clients/client4/web18/web managed by ISPConfig. I read ISPConfig put an attributes on this kind of directories. /var/www/clients/...
0
votes
0answers
28 views

if the member of any group has only the execute permission will the be able to enter into the directory belongs to that group?

# mkdir -p /test/music # created this dir as a root # chmod g=x,o= /test # rwx--x--- # gpasswd -a x1 root # adding x1 user into the root group # su - x1 # login as x1 $ cd /test ...
1
vote
2answers
59 views

How to delete corrupted directory on Linux

I have a machine which has a directory that seems corrupt. The output of ls -lah is something like: ??????????? ? ? ? ? ? dir_name This used to be a valid directory in a ...
0
votes
0answers
51 views

Shell script - directory size

I have to create a script that calculates the size of a directory given as an argument in bytes, like ./du.sh dir. Optionally I have 2 other arguments: ./du.sh dir 1000 files.txt, where 1000 stands ...
7
votes
1answer
93 views

Why directory with large amounts of entries does not shrink in size after entries are removed?

Close vote notice: While the linked duplicate asks same question, the comments and the only answer do not provide an answer which draws from authoritative source. The answer on my question by Thomas ...
0
votes
3answers
53 views

How to escape parenthesis in bash rmdir?

I have a directory that has a name like 10.2 (14C92) i want to remove using rmdir -rf (to include their content). I do know how to pass a space with \ but I got the result: -bash: syntax error near ...
3
votes
1answer
287 views

Recursive shell script to list files

I'm trying to write a shell script that lists certain types of files in a Directory (and sub-directories). I'm struggling with the recursive part. Here's what I have: #!/bin/sh #download dir ...
6
votes
5answers
681 views

How to delete all directories in a directory older than 2 weeks except the latest one that match a file pattern?

I have the following path: /dir1/dir2/ In this path I have the following directories containing various (not relevant) application detrius: follower1234 1-Dec-2018 follower3456 2-Dec-2018 ...
0
votes
2answers
88 views

A specific directory is completely invisible to “ls” and “ls -la”, but I can “cd” into it

This started happening out of the blue. Originally, I was able to "ls" my "Storage" folder and all 3 subdirectories were listed accordingly. ('Beta Profiles' 'OS Backups' 'Software') Starting ...
0
votes
2answers
95 views

Check if any file exist in a folder when traversing through it

I have this script: local_dir="/some/dir1/" cd $local_dir for i in *.* do # do something ........ # [...........] rm $i done It throws an error when the folder is empty. *:...
1
vote
1answer
26 views

Tool for creating and calling folder structure templates?

Is there a Linux utility for creating templates for directory structures, outside of the scripts packaged with a DE like Gnome or LXDE? (I run openbox and would like to avoid a DE at all costs) There ...
1
vote
2answers
53 views

How to create multiple directories in Ranger?

As in the equivalent of mkdir dir1 dir2 when running in bash. This creates two separate directories, dir1 and dir2. If you run :mkdir dir1 dir2 in ranger, it simply creates a directory called 'dir1 ...
2
votes
3answers
47 views

print all 3-character-sub-directories using shell script in AIX

In my system, there is a /Test directory under which many directories are available. I want to print all directories with 3-character-name, in AIX system. I got code for Gnu/Linux. find /test -...
1
vote
2answers
31 views

Calling dir names from a paramater list file

Wondering if there is a best way to call directory names and iterate as parameter from a list. Example cat /dropbox/script/DirList.txt DIR_A DIR_B DIR_C DIR_D /dropbox/dev/inbox/<DIR_A>/ *.*...
8
votes
3answers
648 views

Flattening directory hierarchy preserving directory names in new directory name

I basically want to go from this: . ├── Alan Walker │   ├── Different World │   │ ├── 01 Intro.mp3 │   │ ├── 02 Lost Control.mp3 │   │ └── cover.jpg │   └── Same World │   ├── 01 Intro.mp3 │...
0
votes
1answer
20 views

Nginx requires identical permissions for a whole path up to a directory “assets” of my app to be able to read and serve assets

I have a web app in the folder: /home/main_user/dir1/dir2/my_web_app/ In there I have an executable file and the folder assets. Nginx is setup this way - to serve assets only: location ~ ^/...
0
votes
2answers
65 views

Shorten very long dir name in bash prompt

How to get from this prompt ~/this/is/a-very-very-long-directory-name/dir to this ~/this/is/a-ver...name/dir in a bash prompt? So shorten directory names longer than nn (20+) characters to ...
0
votes
2answers
99 views

How do I make a file in a user's home directory uneditable to that user but leave the home directory editable?

I've tried a LOT of stuff with chmod and chown, and combinations thereof. I still want the files in the home directory of this user to be readable to the user, just not writable or executable. ...
1
vote
2answers
181 views

How to split a large folder into smaller folders of equal size [closed]

I have one big folder with many file types in it (e.g .txt, .sh). It's about 40Gb. I would like to split it into four parts of 10Gb each. How can I achieve this?
0
votes
1answer
43 views

Trying to remove current directory using rmdir

I created a directory dir at Desktop and then i keyed in cd dir so as to make dir as my current directory and then i typed in the terminal rmdir /home/user_name/Desktop/dir from the dir directory ...
0
votes
3answers
54 views

Using find to list directories that haven't been accessed since a certain date?

Using the stat command one can see and format the last date a directory was accessed. The adate Is it possible to use find to find the directories that were changed before a certain date using a ...